mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 21:38:27 +02:00
Menu designer: Prevent AV, if Menu designer is opened and more then one TPopupMenu are edited and selected in Object inspector.
git-svn-id: trunk@53851 -
This commit is contained in:
parent
ffc1493b4a
commit
b8e6ac48a0
@ -241,20 +241,13 @@ end;
|
||||
|
||||
destructor TMenuDesignerBase.Destroy;
|
||||
begin
|
||||
if (FShadowMenu <> nil) then begin
|
||||
FShadowMenu.Parent:=nil;
|
||||
FreeAndNil(FShadowMenu);
|
||||
end;
|
||||
FreeShadowMenu;
|
||||
FreeAndNil(FShortcuts);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TMenuDesignerBase.FreeShadowMenu;
|
||||
begin
|
||||
if FShadowMenu <> nil then
|
||||
FShadowMenu.SelectedMenuItem:=nil;
|
||||
if Assigned(GlobalDesignHook) then
|
||||
GlobalDesignHook.RemoveAllHandlersForObject(FShadowMenu);
|
||||
FreeAndNil(FShadowMenu);
|
||||
end;
|
||||
|
||||
|
@ -1894,6 +1894,10 @@ end;
|
||||
|
||||
destructor TShadowMenu.Destroy;
|
||||
begin
|
||||
Parent := nil;
|
||||
GlobalDesignHook.RemoveHandlerRefreshPropertyValues(@OnDesignerRefreshPropertyValues);
|
||||
GlobalDesignHook.RemoveHandlerModified(@OnDesignerModified);
|
||||
GlobalDesignHook.RemoveHandlerObjectPropertyChanged(@OnObjectPropertyChanged);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
|
@ -568,8 +568,7 @@ begin
|
||||
end
|
||||
else if (aMenu <> FEditedMenu) then
|
||||
begin
|
||||
FDesigner.ShadowMenu.Free;
|
||||
FDesigner.ShadowMenu := Nil;
|
||||
FDesigner.FreeShadowMenu;
|
||||
FEditedMenu := aMenu;
|
||||
selection := aMenuItem;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user