Application exception : Invalid pointer operation
Posted: Tue Jun 14, 2011 7:07 pm
I am trying to diagnose a problem that occurs when I exit from my application. I am getting an Application exception : Invalid pointer operation. I was originally using TeeChart 8.07, but I upgraded to 8.08 to see if this would help... it did not.
The stack trace is attached as a jpeg.
I believe that the problem is related to the FreeAllSeries method. I have tried to with several different variations of the following:
BarChartSeries : array of TCustomBarSeries;
for i := Low(BarChartSeries) to High(BarChartSeries) do
begin
if(BarChartSeries <> nil) then
begin
// BarChartSeries.Clear();
// BarChartSeries.Destroy();
BarChartSeries.Free();
BarChartSeries := nil;
end;
end;
or this
ChartHMICBEMA: TChart;
for i := 0 to ChartHMICBEMA.SeriesCount - 1 do
begin
if(ChartHMICBEMA.Series <> nil) then
begin
ChartHMICBEMA.Series.Free();
end;
end;
ChartHMICBEMA.Free();
The result is that I get the invalid pointer operation during execution instead of on exit. Is either of these a correct alternative to FreeAllSeries()?
Thanks,
Kent
The stack trace is attached as a jpeg.
I believe that the problem is related to the FreeAllSeries method. I have tried to with several different variations of the following:
BarChartSeries : array of TCustomBarSeries;
for i := Low(BarChartSeries) to High(BarChartSeries) do
begin
if(BarChartSeries <> nil) then
begin
// BarChartSeries.Clear();
// BarChartSeries.Destroy();
BarChartSeries.Free();
BarChartSeries := nil;
end;
end;
or this
ChartHMICBEMA: TChart;
for i := 0 to ChartHMICBEMA.SeriesCount - 1 do
begin
if(ChartHMICBEMA.Series <> nil) then
begin
ChartHMICBEMA.Series.Free();
end;
end;
ChartHMICBEMA.Free();
The result is that I get the invalid pointer operation during execution instead of on exit. Is either of these a correct alternative to FreeAllSeries()?
Thanks,
Kent