mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 23:16:01 +02:00
TAChart: Fix memory leak and images disappearing after save in TChartImageList
git-svn-id: trunk@33217 -
This commit is contained in:
parent
194bd3d594
commit
edb96895c4
@ -160,8 +160,7 @@ begin
|
|||||||
FSeriesCount += 1;
|
FSeriesCount += 1;
|
||||||
end;
|
end;
|
||||||
if Assigned(FOnPopulate) then FOnPopulate(Self);
|
if Assigned(FOnPopulate) then FOnPopulate(Self);
|
||||||
except
|
finally
|
||||||
ClearAllSeries;
|
|
||||||
FreeAndNil(legendItems);
|
FreeAndNil(legendItems);
|
||||||
FreeAndNil(bmp);
|
FreeAndNil(bmp);
|
||||||
end;
|
end;
|
||||||
@ -192,14 +191,14 @@ procedure TChartImageList.WriteData(AStream: TStream);
|
|||||||
var
|
var
|
||||||
ch: TChart;
|
ch: TChart;
|
||||||
begin
|
begin
|
||||||
ch := FChart;
|
ch := Chart;
|
||||||
try
|
try
|
||||||
// Don't write the series images to stream.
|
// Don't write the series images to stream.
|
||||||
// They will be recreated automatically when the chart is assigned on loading.
|
// They will be recreated automatically when the chart is assigned on loading.
|
||||||
Chart := nil;
|
Chart := nil;
|
||||||
inherited WriteData(AStream);
|
inherited WriteData(AStream);
|
||||||
finally
|
finally
|
||||||
FChart := ch;
|
Chart := ch;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user