Application exception : Invalid pointer operation

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kentmy
Newbie
Newbie
Posts: 1
Joined: Wed Nov 26, 2008 12:00 am

Application exception : Invalid pointer operation

Post by kentmy » 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
Attachments
assertion_error.JPG
snapshot of stack trace
assertion_error.JPG (182.07 KiB) Viewed 2860 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Application exception : Invalid pointer operation

Post by Narcís » Thu Jun 16, 2011 7:58 am

Hi Kent,
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()?
It's much easier, try using RemoveAllSeries:

Code: Select all

  Chart1.RemoveAllSeries;
And RemoveSeries for a single series:

Code: Select all

  Chart1.RemoveSeries(Series1);
Or:

Code: Select all

  Chart1.RemoveSeries(0);
If the problem persists please attach a simple example project we can run "as-is" to reproduce the problem here.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply