Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2007 May : Runtime error 216 in a finalization section

www.cryer.info
Managed Newsgroup Archive

Runtime error 216 in a finalization section

Subject:Runtime error 216 in a finalization section
Posted by:"Mathieu" (m..@anon.ca)
Date:Mon, 7 May 2007 11:57:49

Hello everyone,

every time I close my application I get an "Exception error 216" on the
.Free in a finalization section. I already looked over the newsgroups to
find an answer, and my guess is that I free the same object two times.
But I can't understand what I do wrong.

Here's some parts of my code that might be relevant for my problem:

___

unit GL_CC_ReportCollection;

interface

uses Forms, Windows, Controls, Contnrs, UCrpeClasses, UCrpe32, SysUtils,
      CRAXDDRT_TLB, CrystalActiveXReportViewerLib11_TLB, COMObj, OleCtrls,
      GL_SU_CustomBaseForm, Variants;


type
   TGL_CC_ReportCollection = class( TComponentList )
   private
     CrystalActiveXReportViewer : TCrystalActiveXReportViewer;
     oRpt,
     oApp         : variant;
   protected
     // some procedures and functions
   public
     class procedure OpenExistingReport( sReportFileName : String;
                                         parametres : Variant;
                                         fromMenuPrinc   : Boolean = True
     // some procedures and functions
   end;

class procedure TGL_CC_ReportCollection.OpenExistingReport(
sReportFileName : String;
                                                             parametres
      : Variant;

fromMenuPrinc   : Boolean = True) ;
begin
   if NOT Assigned(FCrystalReportCollection) then
     FCrystalReportCollection := TGL_CC_ReportCollection.Create( True );

   FCrystalReportCollection.openReportRecherches( sReportFileName,
parametres, fromMenuPrinc);
end;                         // OpenReport..end


finalization
   if Assigned(FCrystalReportCollection) then
     FCrystalReportCollection.Free;

___


I know it might not be enough to find the solution to my problem, so do
not hesitate to ask me for more information.

Best regards,

Mathieu

Replies:

www.cryer.info
Managed Newsgroup Archive