You've already forked lazarus-ccr
SpkToolbar: Fix crash when a popupmenu used by a button is destroyed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8962 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -20,7 +20,7 @@ unit spkt_Tab;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
uses LazLoggerBase,
|
||||
Graphics, Controls, Classes, SysUtils, Math,
|
||||
SpkMath,
|
||||
spkt_Appearance, spkt_Const, spkt_Dispatch, spkt_Exceptions,
|
||||
@ -686,11 +686,17 @@ begin
|
||||
end;
|
||||
|
||||
procedure TSpkTabs.Notify(Item: TComponent; Operation: TOperation);
|
||||
var
|
||||
i: Integer;
|
||||
tab: TSpkTab;
|
||||
begin
|
||||
inherited Notify(Item, Operation);
|
||||
|
||||
DebugLn('[TSpkTabs.Notify] Removing ' + Item.ClassName);
|
||||
|
||||
case Operation of
|
||||
opInsert:
|
||||
if Item is TSpkTab then
|
||||
begin
|
||||
// Setting the dispatcher to nil will cause that during the
|
||||
// ownership assignment, the Notify method will not be called
|
||||
@ -705,17 +711,23 @@ begin
|
||||
TSpkTab(Item).ToolbarDispatch := self.FToolbarDispatch;
|
||||
end;
|
||||
opRemove:
|
||||
if not(csDestroying in Item.ComponentState) then
|
||||
if (Item is TSpkTab) then
|
||||
begin
|
||||
TSpkTab(Item).ToolbarDispatch := nil;
|
||||
TSpkTab(Item).Appearance := nil;
|
||||
TSpkTab(Item).Images := nil;
|
||||
TSpkTab(Item).DisabledImages := nil;
|
||||
TSpkTab(Item).LargeImages := nil;
|
||||
TSpkTab(Item).DisabledLargeImages := nil;
|
||||
// TSpkTab(Item).ImagesWidth := 0;
|
||||
// TSpkTab(Item).LargeImagesWidth := 0;
|
||||
end;
|
||||
if not(csDestroying in Item.ComponentState) then
|
||||
begin
|
||||
TSpkTab(Item).ToolbarDispatch := nil;
|
||||
TSpkTab(Item).Appearance := nil;
|
||||
TSpkTab(Item).Images := nil;
|
||||
TSpkTab(Item).DisabledImages := nil;
|
||||
TSpkTab(Item).LargeImages := nil;
|
||||
TSpkTab(Item).DisabledLargeImages := nil;
|
||||
end;
|
||||
end else
|
||||
for i := 0 to Count-1 do
|
||||
begin
|
||||
tab := Items[i];
|
||||
tab.Panes.Notify(Item, Operation);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user