OnDestroy order inside SRVTabSet.pas
Posted: Fri May 24, 2019 11:20 pm
Hi Sergey,
I started using EurekaLog to track down exceptions and found that on program close there is an issue inside SRVTabSet.pas
I think that in this code:
destructor TSRVTabSet.Destroy;
begin
FTabs.Free;
FCloseButton.Free;
FMargins.Free;
Buffer.Free;
SkinManager := nil;
ImageList := nil;
inherited;
end;
FTabs is freed first but at some point after that GetShowTabCount is called and causes an exception.
I changed it to:
destructor TSRVTabSet.Destroy;
begin
FCloseButton.Free;
FMargins.Free;
Buffer.Free;
SkinManager := nil;
ImageList := nil;
FTabs.Free; // moved here
inherited;
end;
and the issue is now gone.
Maybe I am wrong but you may want to have a look.
All the best,
Romeo
I started using EurekaLog to track down exceptions and found that on program close there is an issue inside SRVTabSet.pas
I think that in this code:
destructor TSRVTabSet.Destroy;
begin
FTabs.Free;
FCloseButton.Free;
FMargins.Free;
Buffer.Free;
SkinManager := nil;
ImageList := nil;
inherited;
end;
FTabs is freed first but at some point after that GetShowTabCount is called and causes an exception.
I changed it to:
destructor TSRVTabSet.Destroy;
begin
FCloseButton.Free;
FMargins.Free;
Buffer.Free;
SkinManager := nil;
ImageList := nil;
FTabs.Free; // moved here
inherited;
end;
and the issue is now gone.
Maybe I am wrong but you may want to have a look.
All the best,
Romeo