I used TeeChart v7.08 Win32 for Delphi 2006.
Sometimes Access Violation appears.
I analysed the nature of this error and prepare small Test Project to reproduce it. But I don't found, how I can sand it.
--------
Problem consists in the following:
1. TeeChart Owner component is destroyed.
2. TeeChart.Series.DataSource is destroyed before TeeChart.
TeeChart.Series.DataSource is not set to nil on DataSource.RemoveNotify as csDestroying in ComponentState => TChartSeries.InternalRemoveDataSource does nothing.
3. Memory used for TeeChart.Series.DataSource is reallocated.
4. TeeChart destructor is called.
Further Error CallStack follows:
TCustomAxisPanel.Destroy
TCustomAxisPanel.FreeAllSeries
TChartSeries.SetParentChart
TCustomAxisPanel.RemoveSeries
TChartSeries.Removed
TChartSeries.RemoveAllLinkedSeries
TObject(DataSources[0]) is TChartSeries - Access Violation
Access Violation in TeeChart v7.08
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Impet,
It would be very helpful if you could arrange a simple example project we can run "as-is" to reproduce the problem here.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
It would be very helpful if you could arrange a simple example project we can run "as-is" to reproduce the problem here.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
I post my files at news://www.steema.net/steema.public.attachments newsgroup "Access Violation in TeeChart v7.08 (Test Project)"
Hi Impet,
to solve it you can add a FreeAllSeries method into the destructor :
to solve it you can add a FreeAllSeries method into the destructor :
Code: Select all
destructor TForm2.Destroy;
var
Temp: Pointer;
Size: Integer;
begin
//!!! Next code is for example only (is not real)
//!!! It destroy ClientDataSet1 before DBChart1 and simulate Delphi memory
//!!! manager work for reallocated ClientDataSet1 memory
Temp := ClientDataSet1;
Size := ClientDataSet1.InstanceSize;
DBChart1.FreeAllSeries(nil);
FreeAndNil(ClientDataSet1);
FillChar(Temp^, Size, 0);
inherited;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com