Memory Leak in TRichView.OnReadHyperlink?
Posted: Fri Oct 10, 2008 11:32 am
Hi,
in my projekt I use a TRichView-Component named "rvwEintraege_B" and fill it with a blob from a database:
To view and use the stored hyperlinks, I put the following code into then OnReadHyperlin-Event:
Now I can use Hyperlinks, but the application exits with the following mermory leak (using FastMM4):
... from the event, there is no the memory leak anymore.
I'm also using TDBRichViewEdit to edit the data, but here no memory leak is detected, even though I use the same code.
Any suggestions, thanks,
Tom
in my projekt I use a TRichView-Component named "rvwEintraege_B" and fill it with a blob from a database:
Code: Select all
blob := CreateBlobStream(qry.FieldByName('langtext'), bmRead);
try
blob.Seek(0, soFromBeginning);
rvwEintraege_B.LoadRTFFromStream(blob);
finally
blob.Free;
end;
Code: Select all
procedure TfrmMain.rvwEintraege_BReadHyperlink(Sender: TCustomRichView;
const Target, Extras: string; DocFormat: TRVLoadFormat; var StyleNo,
ItemTag: Integer; var ItemName: string);
begin
inherited;
ItemTag := Integer(StrNew(PChar(Target)));
end;
If I remove...This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer):
13 - 20 bytes: Unknown x 2
Note: Memory leak detail is logged to a text file in the same folder as this application. To disable this memory leak check, undefine "EnableMemoryLeakReporting".
Code: Select all
ItemTag := Integer(StrNew(PChar(Target)));
I'm also using TDBRichViewEdit to edit the data, but here no memory leak is detected, even though I use the same code.
Any suggestions, thanks,
Tom