[SOLVED] TChart with Minors bug (unfreed memory blocks)!? lazarus / 55-TAChart ---------------------------------------------------------------------- eaea · 2018-05-04 21:24 Hello to all! This is my first post here (and one of my few post ever in my life to a forum), so please be patient with me  When Minors are added to a TChartAxis of a TChartAxisList of a TChart and some Point are added to the charts' series (here: Chart1LineSeries1) and the application is closed then there are unfreed memory blocks reported. I have tried to manually clear, free, destroy the series and the chart in various order, with no effect. In the attachment's zip-file is a minimalistic project of few lines, which demonstrates this. Lazarus version: 1.8.2 (2018-03-30) FPC version: 3.0.4 SVN revision: 57369 OS: Windows 10, x86 64 bit Ether this is a bug or I'm doing something wrong... Greetings To the admin: I wrote this post some minutes ago, but i cannot find it anymore - maybe its lost. Please delete the previous post. ---------------------------------------------------------------------- wp · 2018-05-04 22:02 I can confirm the issue, I will have a look... ---------------------------------------------------------------------- wp · 2018-05-06 21:13 Thank you for waiting. Fixed in r57796, Lazarus trunk. back-porting to the next fixes release is requested. Since you use version 1.8.2 you must appy the patch manually if you want to have the fix immediately: Open file tachartaxis.pas (from (lazarus)/components/tachart)Find the procedure "DrawMinors", it is nested within TChartAxis.Draw and should begin near line 464.Replace the entire "DrawMinors" procedure by the following code:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   procedure DrawMinors(AFixedCoord: Integer; AMin, AMax: Double);  const    EPS = 1e-6;  var    j: Integer;    minorMarks: TChartValueTextArray;    m: TChartValueText;  begin    if IsNan(AMin) or (AMin = AMax) then exit;    for j := 0 to Minors.Count - 1 do begin      minorMarks := Minors[j].GetMarkValues(AMin, AMax);      if minorMarks = nil then continue;      with FHelper.Clone do        try          FAxis := Minors[j];          // Only draw minor marks strictly inside the major mark interval.          FValueMin := Max(FAxisTransf(AMin), FValueMin);          FValueMax := Min(FAxisTransf(AMax), FValueMax);          if FValueMax <= FValueMin then            continue;          ExpandRange(FValueMin, FValueMax, -EPS);          FClipRangeDelta := 1;          try            BeginDrawing;            for m in minorMarks do              DrawMark(AFixedCoord, FHelper.FAxisTransf(m.FValue), m.FText);        finally            EndDrawing;          end;        finally          Free;        end;    end;  end; Save and recompile Lazarus by "Tools" > "Build Lazarus with profile...". This wil take a while. When the process is finished Lazarus will restart with the fix included. ---------------------------------------------------------------------- eaea · 2018-05-10 20:15 Hello ... this works great - thank you very much! Greetings (How to mark a topic solved???) ---------------------------------------------------------------------- howardpc · 2018-05-10 20:18 You (the topic originator) are able to edit the topic Subject to include "SOLVED" or some such.