Designer: Use PopupMenuComponentEditor property to prevent a memory leak. Issue #36872.

git-svn-id: trunk@62928 -
This commit is contained in:
juha 2020-04-10 21:31:09 +00:00
parent 0a548cf17d
commit 0726d31a26

View File

@ -2413,7 +2413,6 @@ var
var var
SenderParentForm: TCustomForm; SenderParentForm: TCustomForm;
SelectedPersistent: TSelectedControl; SelectedPersistent: TSelectedControl;
CompEditor: TBaseComponentEditor;
DesignSender, MouseDownControl: TControl; DesignSender, MouseDownControl: TControl;
RubberBandWasActive, Handled: Boolean; RubberBandWasActive, Handled: Boolean;
p, PopupPos: TPoint; p, PopupPos: TPoint;
@ -2530,11 +2529,11 @@ begin
Selection.AssignPersistent(MouseDownComponent); Selection.AssignPersistent(MouseDownComponent);
if (ssDouble in MouseDownShift) and (Selection.SelectionForm = Form) then if (ssDouble in MouseDownShift) and (Selection.SelectionForm = Form) then
begin // Double Click -> invoke 'Edit' of the component editor begin // Double Click -> invoke 'Edit' of the component editor
CompEditor:=TheFormEditor.GetComponentEditor(MouseDownComponent); PopupMenuComponentEditor := GetComponentEditorForSelection;
Assert(Assigned(CompEditor), Assert(Assigned(PopupMenuComponentEditor),
'TDesigner.MouseUpOnControl: no component editor found for ' 'TDesigner.MouseUpOnControl: no component editor found for '
+MouseDownComponent.Name+':'+MouseDownComponent.ClassName); +MouseDownComponent.Name+':'+MouseDownComponent.ClassName);
CompEditor.Edit; PopupMenuComponentEditor.Edit;
end; end;
end; end;
end end