mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-21 23:19:29 +02:00
LCL: TWinControl.Destroy: undock all DockCLients
git-svn-id: trunk@23036 -
This commit is contained in:
parent
a0992b75f0
commit
957ae67d77
@ -3919,8 +3919,7 @@ begin
|
||||
// undock from old HostSite
|
||||
// - this only undocks from the DockManager
|
||||
// - this control still uses the DockSite as parent control
|
||||
{ TODO -cdocking : Combine with ManualFloat, for consistent handling
|
||||
}
|
||||
{ TODO -cdocking : Combine with ManualFloat, for consistent handling }
|
||||
DebugLn('TControl.ManualDock UNDOCKING ',Name);
|
||||
Result:=HostDockSite.DoUndock(NewDockSite,Self);
|
||||
end;
|
||||
|
@ -4989,7 +4989,7 @@ var
|
||||
i: integer;
|
||||
AWinControl: TWinControl;
|
||||
begin
|
||||
///DebugLn(['TWinControl.DestroyHandle START ',DbgSName(Self)]);
|
||||
//DebugLn(['TWinControl.DestroyHandle START ',DbgSName(Self)]);
|
||||
if not HandleAllocated then begin
|
||||
DebugLn('Warning: TWinControl.DestroyHandle ',Name,':',ClassName,' Handle not Allocated');
|
||||
//RaiseGDBException('');
|
||||
@ -6284,6 +6284,7 @@ begin
|
||||
Control := Controls[n - 1];
|
||||
//DebugLn('[TWinControl.Destroy] C ',Name,':',ClassName,' ',Control.Name,':',Control.ClassName);
|
||||
Remove(Control);
|
||||
//DebugLn(['TWinControl.Destroy ',DbgSName(Control.HostDockSite)]);
|
||||
if Control.HostDockSite = Self then
|
||||
Control.HostDockSite := nil;
|
||||
// don't free the control just set parent to nil
|
||||
@ -6293,6 +6294,13 @@ begin
|
||||
n := ControlCount;
|
||||
end;
|
||||
|
||||
// undock controls that use this as HostDockSite
|
||||
while DockClientCount>0 do begin
|
||||
Control:=DockClients[DockClientCount-1];
|
||||
//DebugLn(['TWinControl.Destroy ',DbgSName(Self),' undocking ',DbgSName(Control)]);
|
||||
Control.HostDockSite:=nil;
|
||||
end;
|
||||
|
||||
FreeThenNil(FBrush);
|
||||
FreeThenNil(FChildSizing);
|
||||
if (FDockManager<>nil) then
|
||||
|
Loading…
Reference in New Issue
Block a user