View Issue Details

IDProjectCategoryView StatusLast Update
0037027PackagesLazReportpublic2020-10-29 22:32
ReporterZdravko Gabrovski Assigned ToJesus Reyes  
PrioritynormalSeverityminorReproducibilityunable to reproduce
Status resolvedResolutionno change required 
PlatformWin64OSWindows 
Summary0037027: AV n lr_previewtoolsabstract.pas on application exit in debug mode wit LazReport and lrEmailExportfiler
DescriptionIn my project, I am using Lazreport and lrEmailExportfiler - TlrPreviewToolsAbstract ancestor in Auto-created Datamodule.
When I close the applicarion in debug mode, it raise a AV exception (SigKill) in procedure UnRegisterLRExportFilter(AFilter: TlrPreviewToolsAbstract); in lr_previewtoolsabstract.pas.
The reason is that it executes DoFreeExportFilters; in finalization section in the same lr_previewtoolsabstract.pas unit, which does FreeAndNil(lrExportFilters); before destroying the filter class, descendant of TlrPreviewToolsAbstract class. In TlrPreviewToolsAbstract.Destroy method it call UnRegisterLRExportFilter(Self), but lrExportFilters is allready freed.

The solution is a small fix in UnRegisterLRExportFilter, which will check if lrExportFilters if availabe or not:

procedure UnRegisterLRExportFilter(AFilter: TlrPreviewToolsAbstract);
var
  i: Integer;
begin
if Assigned( lrExportFilters ) then begin <---- Fix
  i:=lrExportFilters.IndexOf(AFilter);
  if i>=0 then
    lrExportFilters.Delete(i);
  end;
end;
Steps To Reproducei can not reproduce in empty project
TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Activities

Zdravko Gabrovski

2020-05-05 20:21

reporter  

lr_previewtoolsabstract.diff (510 bytes)   
Index: components/lazreport/source/lr_previewtoolsabstract.pas
===================================================================
--- components/lazreport/source/lr_previewtoolsabstract.pas	(revision 63115)
+++ components/lazreport/source/lr_previewtoolsabstract.pas	(working copy)
@@ -66,9 +66,11 @@
 var
   i: Integer;
 begin
+if Assigned( lrExportFilters ) then begin
   i:=lrExportFilters.IndexOf(AFilter);
   if i>=0 then
     lrExportFilters.Delete(i);
+  end;
 end;
 
 { TlrPreviewToolsAbstract }

Zdravko Gabrovski

2020-05-05 21:51

reporter   ~0122639

I am very sorry, it is my fault. Please, close the issue and do not apply the patch.

Zdravko Gabrovski

2020-10-29 17:38

reporter   ~0126640

Nothing to do, please close.

Issue History

Date Modified Username Field Change
2020-05-05 20:21 Zdravko Gabrovski New Issue
2020-05-05 20:21 Zdravko Gabrovski File Added: lr_previewtoolsabstract.diff
2020-05-05 21:51 Zdravko Gabrovski Note Added: 0122639
2020-10-27 14:04 Jesus Reyes Assigned To => Jesus Reyes
2020-10-27 14:04 Jesus Reyes Status new => assigned
2020-10-29 17:38 Zdravko Gabrovski Note Added: 0126640
2020-10-29 22:32 Jesus Reyes Status assigned => resolved
2020-10-29 22:32 Jesus Reyes Resolution open => no change required
2020-10-29 22:32 Jesus Reyes LazTarget => -