mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 01:59:34 +02:00
destroying clean up
git-svn-id: trunk@6334 -
This commit is contained in:
parent
5c02893c8b
commit
2efd1ba30a
@ -1013,10 +1013,7 @@ begin
|
||||
if (Screen.Forms[I].Menu = Value) and (Screen.Forms[I] <> Self) then
|
||||
raise EInvalidOperation.CreateFmt(sDuplicateMenus, [Value.Name]);
|
||||
|
||||
if FMenu<>nil then begin
|
||||
FMenu.Parent:=nil;
|
||||
|
||||
end;
|
||||
if FMenu<>nil then FMenu.Parent:=nil;
|
||||
|
||||
if (csDestroying in ComponentState) or
|
||||
((Value <> nil) and (csDestroying in Value.ComponentState))
|
||||
@ -1823,6 +1820,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.167 2004/12/05 13:25:47 mattias
|
||||
destroying clean up
|
||||
|
||||
Revision 1.166 2004/12/05 13:20:29 mattias
|
||||
destroying TMenu Handle when Set Parent=nil
|
||||
|
||||
|
@ -54,8 +54,10 @@ procedure TMenu.SetParent(const AValue: TComponent);
|
||||
begin
|
||||
if FParent=AValue then exit;
|
||||
FParent:=AValue;
|
||||
if (Items<>nil) and Items.HandleAllocated then
|
||||
if (FParent=nil) and (Items<>nil) and Items.HandleAllocated then begin
|
||||
// disconnect from form
|
||||
DestroyHandle;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMenu.ImageListChange(Sender: TObject);
|
||||
@ -242,6 +244,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.28 2004/12/05 13:25:47 mattias
|
||||
destroying clean up
|
||||
|
||||
Revision 1.27 2004/12/05 13:20:29 mattias
|
||||
destroying TMenu Handle when Set Parent=nil
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user