Memory leak?
Posted: Fri Apr 08, 2016 10:56 am
RVE: v14.0.3
Delphi Seattle 10 U1
Adding image to TRichViewEdit and freeing the img when closing the form throws AV.
Sample code:
FastMM snippet:
If I won't explicitly free my image instance, will rve do it for me when I close my app as I see in the log?
Thank you.
Delphi Seattle 10 U1
Adding image to TRichViewEdit and freeing the img when closing the form throws AV.
Sample code:
Code: Select all
rve: TRichViewEdit;
img: TWICImage;
...
procedure TForm1.FormCreate(Sender: TObject);
begin
img := TWICImage.Create;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
//rve.Clear;
img.Free; //<-- throws av,
end;
procedure TForm1.btnLoadPixClick(Sender: TObject);
begin
img.LoadFromFile('image file');
rve.AddPictureEx('', img, -1, rvvaBaseline);
rve.Format;
end;
Code: Select all
FastMM has detected an attempt to call a virtual method on a freed object. An access violation will now be raised in order to abort the current operation.
...
The current thread ID is 0x2864, and the stack trace (return addresses) leading to this error is:
409C2B [System.pas][System][TObject.Free$qqrv][16261]
D585E1 [RVItem.pas][RVItem][TRVGraphicItemInfo.$bdtr$qqrv][3275]
409C2B [System.pas][System][TObject.Free$qqrv][16261]
DC1023 [CRVData.pas][CRVData][TCustomRVData.InternalFreeItem$qqrp24Rvitem.TCustomRVItemInfoo][2132]
CAD86C [CRVFData.pas][CRVFData][TCustomRVFormattedData.InternalFreeItem$qqrp24Rvitem.TCustomRVItemInfoo][8483]
DC10B0 [CRVData.pas][CRVData][TCustomRVData.FreeItem$qqrio][2145]
DC1158 [CRVData.pas][CRVData][TCustomRVData.Clear$qqrv][2161]
C99247 [CRVFData.pas][CRVFData][TCustomRVFormattedData.Clear$qqrv][872]
41C964 [FastMM4.pas][FastMM4][DebugFreeMem$qqrpv][8893]
C8F1A8 [RVRVData.pas][RVRVData][TRichViewRVData.Clear$qqrv][1282]
CCDD8B [RVERVData.pas][RVERVData][TRVEditRVData.Clear$qqrv][522]
Thank you.