PrintPreview Resource Leak
In the application I'm using an obscure resource leak occurred. I could not figure out, why my code would be wrong after having been 'Print Previewed'. Until I researched the Preview.pas itself. The TThumbnailPreview destructor does not free the LargeImages. When I added an extra line of code, the resource leaks were gone. So please fix the following:
- Code: Select all
destructor TThumbnailPreview.Destroy;
begin
LargeImages.Free; // <<==-- Add this line to prevent obscure resource leaks
FPaperViewOptions.Free;
Page.Free;
inherited Destroy;
end;