From: <Dav...@us...> - 2006-02-13 15:56:31
|
Revision: 587 Author: DavidVTaylor Date: 2006-02-13 07:56:16 -0800 (Mon, 13 Feb 2006) ViewCVS: http://svn.sourceforge.net/instantobjects?rev=587&view=rev Log Message: ----------- Fix for bug #1423177 - Memory leak handling exceptions. EInstantError exception wrapping mechanism incorrectly used AcquireExceptionObject and ReleaseExceptionObject functions. Bug impacted only Delphi 6 and later versions. Modified Paths: -------------- trunk/Source/Core/InstantClasses.pas Modified: trunk/Source/Core/InstantClasses.pas =================================================================== --- trunk/Source/Core/InstantClasses.pas 2006-02-13 10:43:58 UTC (rev 586) +++ trunk/Source/Core/InstantClasses.pas 2006-02-13 15:56:16 UTC (rev 587) @@ -599,20 +599,15 @@ destructor EInstantError.Destroy; begin - {$IFDEF D6+} - ReleaseExceptionObject; - {$ELSE} - FOriginalException.Free; - {$ENDIF} + FreeAndNil(FOriginalException); inherited; -end; +end; procedure EInstantError.Initialize(E: TObject); begin {$IFDEF D6+} - FOriginalException := AcquireExceptionObject; - if FOriginalException <> E then - FOriginalException := nil; + if ((ExceptObject <> nil) and (ExceptObject = E)) then + FOriginalException := AcquireExceptionObject; {$ELSE} if Assigned(E) and (RaiseList <> nil) and (PRaiseFrame(RaiseList)^.ExceptObject = E) then @@ -1373,7 +1368,7 @@ Esc := Format(EscStr, [Format('#%d', [Ord(C)])]); WriteString(Esc); end; -*) +*) end; end; @@ -1728,7 +1723,7 @@ end; Reader.ReadListEnd; end; -*) +*) vaIdent: Producer.WriteEscapedData(Reader.ReadIdent); vaFalse: |