Forum > Packages and Libraries

TATTabs memory leak

<< < (2/5) > >>

Alextp:
According to your info,I added deallocation of Data's. Pls get GitHub version and test?

chrv:
For me, it still leaking

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---destructor TATTabListCollection.Destroy;var  i : integer;begin  For i := Count-1 downto 0 do    Items[i].Free;  inherited Destroy;end;   It seems Count allready = 0 at this point.

Alextp:
Yes, Count is 0, changed that place.
Leaking: I don't have an idea.

Alextp:
I run the demo_tabs from ATFlatControls, with 'heaptrc' checkbox in IDE options, and see NO leaks.

--- Quote ---Heap dump by heaptrc unit of /home/user/cuda/atflatcontrols/app/demo_tabs/demo
12747 memory blocks allocated : 27977489/27999088
12747 memory blocks freed     : 27977489/27999088
0 unfreed memory blocks : 0
True heap size : 2686976
True free heap : 2686976
 
--- End quote ---

this is after fixing that demo_tabs.

tom.tom:
Yeah, there is something strange with memory leak when assigning the dynamic string to the TabCaption property. It looks like a false positive report though...

No leak reported:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  for ids := 1 to CameraTabs.TabCount do  begin    tabData := CameraTabs.GetTabData(Pred(idx));    tabData.TabCaption := 'test';  end; 
[TabCount-1] leaks reported where the TabCaption is assigned:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  for idx:= 1 to CameraTabs.TabCount do  begin    tabData := CameraTabs.GetTabData(Pred(idx));    tabData.TabCaption := Format('%d: %s', [idx, 'test']);;  end; 
Isn't it because heaptrc gets confused because tabData is just a reference and never freed locally?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version