Page 1 of 1

Memory leak in the v6

Posted: Mon May 03, 2004 3:51 pm
by 9080808
We are using TeeChart Pro v6.0.0.4 and when adding and deleting an annotation tool into a chart, it leaks aproximately 700 bytes of memory each time.

Code: Select all

    Dim index As Integer
    
    index = TChart1.Tools.Add(tcAnnotate)
    TChart1.Tools.Delete (index)
I think the Delete method does not actually delete the tool, because, if I don't call it, the leak it's almost the same.

It is solved in any version of TeeChart?

Thanks for your help.

Posted: Mon May 03, 2004 5:51 pm
by Pep
Hi Jesus,

I've tried the following code here using the latest TeeChart Pro v6.04 and works as expected (memory does not leaks) , also the tool is deleted. Could you please check it ?

Code: Select all

Private Sub Command1_Click()
  Dim index As Integer
    index = TChart1.Tools.Add(tcAnnotate)
'    TChart1.Tools.Delete (index)
End Sub

Private Sub Form_Load()
With TChart1
    .AddSeries scLine
    .Series(0).FillSampleValues (10)
End With
End Sub
If you still having problems, could you please post the code with which I can reproduce the problem "as - is" here ?

Posted: Tue May 04, 2004 7:31 am
by 9080808
I made a test program that consist only in an empty TChart and a button, and the code is:

Code: Select all

Private Sub Command1_Click()
    Dim counter As Long
    Dim index As Integer
    
    For counter = 1 To 5000
        index = TChart1.Tools.Add(tcAnnotate)
        TChart1.Tools.Delete (index)
    Next counter
End Sub
This code leaks about 3500 Kb each time button is pressed.

Posted: Tue May 04, 2004 9:36 am
by Pep
Hi Jesus,

yes, you're correct, I'm are able to reproduce the problem. It has been logged on our defect list for investigation. Thankyou for the report.

Posted: Tue May 04, 2004 10:13 am
by 9080808
I'm glad to help :wink: