Page 1 of 1

TMarkTools causes Access Violation Error if Series is empty

Posted: Wed Feb 08, 2012 2:49 pm
by 16561241
Hello

TeeChart2011.04.41118+BDS2006

with following project, whenever I move the mouse over the TChart, there will be access violation unless I disable the TMarkTools, or the series is not empty.

Steps:
1. Drop a TChart to the Form
2. Double click the Chart, and add an AreaSeries at design time
3. Double click the chart, and add a TMarkTool
4. in Form OnCreate event, have following code:

procedure TForm2.FormCreate(Sender: TObject);
var
AreaSeries: TAreaSeries;
begin
AreaSeries:=TAreaSeries.Create(Self);
AreaSeries.ParentChart :=Chart1;
AreaSeries.FillSampleValues(5);
AreaSeries.Marks.Visible :=False;
AreaSeries.LinePen.Visible :=False;
AreaSeries.AreaLinesPen.Visible := False;
AreaSeries.LinePen.Visible := False;
AreaSeries.MultiArea := maStacked;
end;


Run the application, and move the mouse, then you will have access violation error.

The reason for an empty series at step2 is that in the real situation, the series are linked to a source of TDataSet, who might be empty, where the problem is actually happened.

Detail please find in attachment. It contain the source code and also the exception call stack caught by Eurekalog.

Re: TMarkTools causes Access Violation Error if Series is empty

Posted: Thu Feb 09, 2012 1:23 pm
by yeray
Hi,

I could reproduce it and found where the problem was. I've fixed it for the next maintenance release (TV52016025).

Re: TMarkTools causes Access Violation Error if Series is empty

Posted: Sun Feb 12, 2012 1:29 pm
by 16561241
When the update will be released?

We have to deliver our SW by the end of Feb. Can we have the update of TeeChart by then?

Re: TMarkTools causes Access Violation Error if Series is empty

Posted: Mon Feb 13, 2012 10:37 am
by yeray
Hi,

I don't think we'll publish a maintenance release this month. However, as the fix is simple, if you are source code customer you can apply it yourself.
The line 1653 in Series.pas says:

Code: Select all

    if (Index>=tmpFirst) and ClickableLine then
Change it for:

Code: Select all

    if (Index>tmpFirst) and ClickableLine then
If you are not a source code customer, just tell us and we'll study if we can prepare a release for you.

Re: TMarkTools causes Access Violation Error if Series is empty

Posted: Tue Feb 14, 2012 1:42 am
by 16561241
bug solved.

Thanks.