OnDestroy order inside SRVTabSet.pas

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Romeo_Popescu
Posts: 6
Joined: Tue Jul 15, 2008 10:47 pm
Location: Guelph, Ontario, Canada

OnDestroy order inside SRVTabSet.pas

Post by Romeo_Popescu »

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
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: OnDestroy order inside SRVTabSet.pas

Post by Sergey Tkachenko »

Yes, this is a bug, move ImageList := nil; to the beginning of the destructor.
Post Reply