Page 1 of 1

memory leak, removing duplicate images

Posted: Sat Nov 25, 2006 6:23 pm
by krho

Code: Select all

Stack trace of when this block was allocated (return addresses):
4030BE [system.pas][System][System.@GetMem][2648]
6ED5B8 [pngimage][pngimage.TPNGPointerList.SetSize]
6F243E [pngimage.pas][pngimage][pngimage.TPNGObject.LoadFromStream][4972]
4416D9 [Graphics.pas][Graphics][Graphics.TGraphic.LoadFromFile][3726]
442520 [Graphics.pas][Graphics][Graphics.TPicture.LoadFromFile][4107]
7921D2 [RVHTMLImport.pas][rvhtmlimport][rvhtmlimport.TRvHtmlImporter.ReadImage][1522]
794757 [RVHTMLImport.pas][rvhtmlimport][rvhtmlimport.TRvHtmlImporter.LoadHtml][2467]
7AFA97 [fComposeEditorRichView.pas][fComposeEditorRichView][fComposeEditorRichView.TfrmComposeEditorRichView.InsertText][313]
8B808F [fCompose.pas][fCompose][fCompose.TfrmCompose.loadMimePartToEditor][1928]

This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer):

1 - 4 bytes: Unknown x 4
13 - 20 bytes: TPNGList x 2, TChunkIEND x 2, String x 1, Unknown x 2
21 - 28 bytes: TPen x 2, TBrush x 2
29 - 36 bytes: TFont x 2, Unknown x 2
37 - 44 bytes: TPicture x 2, Unknown x 2
61 - 76 bytes: Unknown x 1
77 - 92 bytes: TChunkIDAT x 2, TCanvas x 2
557 - 620 bytes: TPNGObject x 2
1037 - 1148 bytes: TChunkIHDR 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".
(I left only one item above)
It seems that html importer leaks memory when adding images into rvhtmledit. I don't know when those images are supposed to be freed.

Other thing is. How to remove/disable including more than one image into final html, if you have more than one equal image. e.g. you add 10 same smilies in message you get 10 calls to OnSaveImage2

Regards,
Miha

Posted: Sat Nov 25, 2006 8:20 pm
by Sergey Tkachenko
Confirmed. Fixed version is uploaded.

As for the questions of duplicate images.
Currently, it's not possible to add the same graphic object several times in TRichView. But if all of them will be created using Assign method from one source (instead of loading from file), they will share the same graphic object.