mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 17:58:03 +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;
|
||||
end;
|
||||
if Assigned(FOnPopulate) then FOnPopulate(Self);
|
||||
except
|
||||
ClearAllSeries;
|
||||
finally
|
||||
FreeAndNil(legendItems);
|
||||
FreeAndNil(bmp);
|
||||
end;
|
||||
@ -192,14 +191,14 @@ procedure TChartImageList.WriteData(AStream: TStream);
|
||||
var
|
||||
ch: TChart;
|
||||
begin
|
||||
ch := FChart;
|
||||
ch := Chart;
|
||||
try
|
||||
// Don't write the series images to stream.
|
||||
// They will be recreated automatically when the chart is assigned on loading.
|
||||
Chart := nil;
|
||||
inherited WriteData(AStream);
|
||||
finally
|
||||
FChart := ch;
|
||||
Chart := ch;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user