TAChart: Fix occasional crash when TChartListbox is destroyed.

This commit is contained in:
wp_xyz 2022-04-14 01:11:44 +02:00
parent 09cd44d467
commit 0e03eadf14

View File

@ -313,7 +313,7 @@ begin
end; end;
function TChartListbox.CreateLegendItems: TChartLegendItems; function TChartListbox.CreateLegendItems: TChartLegendItems;
{ creates the a TLegendItems list and populates it with information for { Creates a TLegendItems list and populates it with information for
all series contained in the Chart. In case of MultiLegend items, only all series contained in the Chart. In case of MultiLegend items, only
a single legend item is used } a single legend item is used }
var var
@ -606,6 +606,9 @@ var
list: TIntegerList; list: TIntegerList;
i, idx: Integer; i, idx: Integer;
begin begin
if (csDestroying in ComponentState) then
exit;
Items.BeginUpdate; Items.BeginUpdate;
list := TIntegerList.Create; list := TIntegerList.Create;
try try