mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 17:59:50 +02:00
lcl: fix crashes when using buttonpanel on form (default conrol has not notified form about destruction)
git-svn-id: trunk@19577 -
This commit is contained in:
parent
fb5ae56005
commit
ce343a5f24
@ -32,6 +32,9 @@ const
|
||||
DefShowGlyphs = [pbOK, pbCancel, pbClose, pbHelp];
|
||||
|
||||
type
|
||||
|
||||
{ TPanelBitBtn }
|
||||
|
||||
TPanelBitBtn = class(TCustomBitBtn)
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
|
@ -217,14 +217,20 @@ var
|
||||
begin
|
||||
if NewControl <> FDefaultControl then
|
||||
begin
|
||||
OldDefaultControl:=FDefaultControl;
|
||||
OldDefaultControl := FDefaultControl;
|
||||
FDefaultControl := NewControl;
|
||||
// notify old control
|
||||
if OldDefaultControl<>nil then
|
||||
if OldDefaultControl <> nil then
|
||||
begin
|
||||
OldDefaultControl.RemoveFreeNotification(Self);
|
||||
OldDefaultControl.UpdateRolesForForm;
|
||||
end;
|
||||
// notify new control
|
||||
if FDefaultControl<>nil then
|
||||
if FDefaultControl <> nil then
|
||||
begin
|
||||
FDefaultControl.FreeNotification(Self);
|
||||
FDefaultControl.UpdateRolesForForm;
|
||||
end;
|
||||
// maybe active default control changed
|
||||
if FActiveDefaultControl = nil then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user