Closed circular17 closed 1 year ago
Hi, I've added test_svg_theme project (so we can test the memory leak easily). And I've fixed a memory leak for bcfont in bgrasvgtheme. The other bug is in bgrasvgimagelist, ReadData (line 110) and DefineProperties (line 189).
The problem is that in the Lazarus bugtracker they will not accept this demo I made as test of the memory leak, because it requires bgrabitmap and bgracontrols.
I have the impression that the memory leak is limited to TXMLConfig class and XML functions it uses. So I suppose we can do a test project that only requires TXMLConfig.
program testxmlconf;
uses XMLConf, sysutils;
var
cfg: TXMLConfig;
filename: string;
begin
filename := ExtractFilePath(ParamStr(0))+'temp.xml';
cfg := TXMLConfig.Create(nil);
cfg.SaveToFile(filename);
cfg.Free;
cfg := TXMLConfig.Create(nil);
cfg.LoadFromFile(filename);
cfg.Free;
end.
It results indeed in the same memory leak:
Heap dump by heaptrc unit of /Users/johann/Documents/pascal/testxmlconf/testxmlconf
202 memory blocks allocated : 39538/40008
188 memory blocks freed : 33542/34000
14 unfreed memory blocks : 5996
True heap size : 786432 (64 used in System startup)
True free heap : 777216
Should be : 777672
Call trace for block $0000000101846C00 size 38
Call trace for block $0000000101846000 size 32
Call trace for block $00000001017F5DB0 size 3080
$000000010148F9FF
Call trace for block $0000000101846100 size 40
$000000010148F9FF
Call trace for block $000000010183D600 size 84
Call trace for block $0000000101846400 size 32
Call trace for block $000000010183D740 size 98
Call trace for block $0000000101846300 size 32
Call trace for block $000000010183D880 size 96
Call trace for block $0000000101845E00 size 40
Call trace for block $00000001017F54D0 size 2048
Call trace for block $0000000101845F00 size 32
Call trace for block $000000010186D100 size 128
Call trace for block $0000000101865100 size 216
Ok. Do you want to report it? Or I do?
Thank you very much
Seems that they fixed it in new record time!
Good!
Redirected from https://github.com/bgrabitmap/lazpaint/issues/535
It is expected to have memory leaks with XML though there may be a bit more with this component. Here is log with lazpaint: