Hi everybody,
I just upgraded from TeeChart version 4 to version 7. And now simple piece of code (that worked fine in version 4) produces access violation error (Access violation at address 00000000. Read of address 00000000)
Code:
====================
Chart1.RemoveAllSeries;
Chart1.AddSeries(Serie2);
====================
I just remove current series from the chart and add another one.
Error does not appear when this code is executing, error appears when you close application IF this code WAS executed.
I checked this forum and found several posts about similar (or may be the same problem).
E.g. http://www.teechart.net/support/modules ... 949cc714b6
But unfortunatelly I did not find solution.
Any ideas?
Regards
Alex
access vialoation
Looks like I found solution by myself (source codes much metter than any manual
Before destroying Chart I added code to destroy all Series
Now program works fine.
But it will be nice if you can make some modifications in TeeChart or document this feature
Regards
Alex
Before destroying Chart I added code to destroy all Series
Code: Select all
procedure TChartForm.FormDestroy(Sender: TObject);
begin
//for TeeChart version 7!!!
FreeAndNil(BarSeries);
FreeAndNil(LineSeries);
FreeAndNil(PntSeries);
FreeAndNil(PntLineSeries);
end;
But it will be nice if you can make some modifications in TeeChart or document this feature
Regards
Alex
Hi.
Also, instead of using the RemoveSeries, you can also use the FreeAllSeries or the code bellow:
Also, instead of using the RemoveSeries, you can also use the FreeAllSeries or the code bellow:
Code: Select all
Series2.ParentChart := nil;
Series2.Free;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com