mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 16:31:40 +02:00
destroying TMenu Handle when Set Parent=nil
git-svn-id: trunk@6333 -
This commit is contained in:
parent
a398928537
commit
5c02893c8b
@ -1013,7 +1013,10 @@ begin
|
||||
if (Screen.Forms[I].Menu = Value) and (Screen.Forms[I] <> Self) then
|
||||
raise EInvalidOperation.CreateFmt(sDuplicateMenus, [Value.Name]);
|
||||
|
||||
if FMenu<>nil then FMenu.Parent:=nil;
|
||||
if FMenu<>nil then begin
|
||||
FMenu.Parent:=nil;
|
||||
|
||||
end;
|
||||
|
||||
if (csDestroying in ComponentState) or
|
||||
((Value <> nil) and (csDestroying in Value.ComponentState))
|
||||
@ -1820,6 +1823,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.166 2004/12/05 13:20:29 mattias
|
||||
destroying TMenu Handle when Set Parent=nil
|
||||
|
||||
Revision 1.165 2004/11/20 11:20:06 mattias
|
||||
implemented creating classes at run time from any TComponent descendant
|
||||
|
||||
|
@ -49,12 +49,13 @@ end;
|
||||
{------------------------------------------------------------------------------
|
||||
procedure TMenu.SetParent(const AValue: TComponent);
|
||||
|
||||
Creates the handle ( = object).
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TMenu.SetParent(const AValue: TComponent);
|
||||
begin
|
||||
// ToDo
|
||||
if FParent=AValue then exit;
|
||||
FParent:=AValue;
|
||||
if (Items<>nil) and Items.HandleAllocated then
|
||||
DestroyHandle;
|
||||
end;
|
||||
|
||||
procedure TMenu.ImageListChange(Sender: TObject);
|
||||
@ -241,6 +242,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.27 2004/12/05 13:20:29 mattias
|
||||
destroying TMenu Handle when Set Parent=nil
|
||||
|
||||
Revision 1.26 2004/11/10 20:53:18 vincents
|
||||
Destroy menu handle, when destroying form handle.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user