mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 06:20:34 +02:00
nil FHostDockSite of child control on parent TWinControl destroying (in other case - crash if control is docked into another control)
git-svn-id: trunk@13639 -
This commit is contained in:
parent
bf7f64a57c
commit
880afb7010
@ -2388,14 +2388,18 @@ var
|
||||
Kind: TAnchorKind;
|
||||
begin
|
||||
inherited Notification(AComponent, Operation);
|
||||
if Operation = opRemove then begin
|
||||
if AComponent = PopupMenu then PopupMenu := nil
|
||||
else if AComponent = Action then Action := nil;
|
||||
if Operation = opRemove then
|
||||
begin
|
||||
if AComponent = PopupMenu then
|
||||
PopupMenu := nil
|
||||
else
|
||||
if AComponent = Action then
|
||||
Action := nil;
|
||||
//debugln('TControl.Notification A ',DbgSName(Self),' ',DbgSName(AComponent));
|
||||
for Kind:=Low(TAnchorKind) to High(TAnchorKind) do begin
|
||||
if (FAnchorSides[Kind]<>nil) and (FAnchorSides[Kind].Control=AComponent)
|
||||
then
|
||||
FAnchorSides[Kind].FControl:=nil;
|
||||
for Kind := Low(TAnchorKind) to High(TAnchorKind) do
|
||||
begin
|
||||
if (FAnchorSides[Kind] <> nil) and (FAnchorSides[Kind].Control = AComponent) then
|
||||
FAnchorSides[Kind].FControl := nil;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
@ -5468,8 +5468,10 @@ begin
|
||||
ListRemove(FTabList, AControl);
|
||||
ListRemove(FWInControls, ACOntrol);
|
||||
end else
|
||||
Listremove(FControls, AControl);
|
||||
AControl.FParent := Nil;
|
||||
ListRemove(FControls, AControl);
|
||||
AControl.FParent := nil;
|
||||
if AControl.FHostDockSite = Self then
|
||||
AControl.FHostDockSite := nil;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user