InspectorBar: problem with FontDialog

I have a situation that generates an error when the FontDialog is opened by an Item with PropertyType ptFont. 


Note that the problem only occurs in my (rather large) app, not in simple test projects. I have tried replicating all operations in the test projects and eliminating any extra operations in the main project but I have not been able to duplicate / eliminate the problem. I understand that this makes any real help very difficult but I am hoping someone might have some ideas or suggestions.
 
The problem is that the InspectorBar.DoExit procedure is being called when the FontDialog closes (after FD.Execute in TInspectorBar.EditBtnClick). This frees the FEditItem before EditBtnClick can update it. In the simple test projects the DoExit is called, but only after the FEditItem has been updated (by StopEdit). 

I have 'fixed' the problem by adding
  if FeditItem.PropertyType = ptFont then
    exit;
to the DoExit procedure - which seems to work and has no obvious side effects but of course I would rather find out what is calling DoExit early and why!

We applied a fix in EditBtnClick which should avoid this 


  AItem := FEditItem;

  if FEditItem.PropertyType = ptFont then
  begin
    FD := TFontDialog.Create(Self);
    FD.Font.Assign(FEditItem.FontValue);
    FD.Font.Height := Round(FDPIScale * FD.Font.Height);
    if FD.Execute then
    begin
      AItem.FontValue.Assign(FD.Font);
      FInspectorEditBtn.Text := FD.Font.Name;
    end;
    StopEdit(AItem);
    Exit;
  end;

This fix will be included in the next release.

Hi Bruno,


As always, fantastic support! Thanks very much :-)