mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 19:52:26 +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;
|
destructor TMenuDesignerBase.Destroy;
|
||||||
begin
|
begin
|
||||||
if (FShadowMenu <> nil) then begin
|
FreeShadowMenu;
|
||||||
FShadowMenu.Parent:=nil;
|
|
||||||
FreeAndNil(FShadowMenu);
|
|
||||||
end;
|
|
||||||
FreeAndNil(FShortcuts);
|
FreeAndNil(FShortcuts);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMenuDesignerBase.FreeShadowMenu;
|
procedure TMenuDesignerBase.FreeShadowMenu;
|
||||||
begin
|
begin
|
||||||
if FShadowMenu <> nil then
|
|
||||||
FShadowMenu.SelectedMenuItem:=nil;
|
|
||||||
if Assigned(GlobalDesignHook) then
|
|
||||||
GlobalDesignHook.RemoveAllHandlersForObject(FShadowMenu);
|
|
||||||
FreeAndNil(FShadowMenu);
|
FreeAndNil(FShadowMenu);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1894,6 +1894,10 @@ end;
|
|||||||
|
|
||||||
destructor TShadowMenu.Destroy;
|
destructor TShadowMenu.Destroy;
|
||||||
begin
|
begin
|
||||||
|
Parent := nil;
|
||||||
|
GlobalDesignHook.RemoveHandlerRefreshPropertyValues(@OnDesignerRefreshPropertyValues);
|
||||||
|
GlobalDesignHook.RemoveHandlerModified(@OnDesignerModified);
|
||||||
|
GlobalDesignHook.RemoveHandlerObjectPropertyChanged(@OnObjectPropertyChanged);
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -568,8 +568,7 @@ begin
|
|||||||
end
|
end
|
||||||
else if (aMenu <> FEditedMenu) then
|
else if (aMenu <> FEditedMenu) then
|
||||||
begin
|
begin
|
||||||
FDesigner.ShadowMenu.Free;
|
FDesigner.FreeShadowMenu;
|
||||||
FDesigner.ShadowMenu := Nil;
|
|
||||||
FEditedMenu := aMenu;
|
FEditedMenu := aMenu;
|
||||||
selection := aMenuItem;
|
selection := aMenuItem;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user