TeeChart Memory Problem
I have a form with reports containing a few DBTeeCharts. After the reports
have run, I sometimes get an access violation when trying to free the form.
I remember reading somewhere that there are some known memory issues with
TeeChart. Is this one of them and is there a work around?
have run, I sometimes get an access violation when trying to free the form.
I remember reading somewhere that there are some known memory issues with
TeeChart. Is this one of them and is there a work around?
This discussion has been closed.
Comments
This has been an issue with ReportBuilder and TeeChart for many years now.
It has to do with the free notification of the TeeChart component when the
owner is not the form. We have submitted detailed examples to Steema
demonstrating the error and they have told us they are working on it. I can
tell you that in some cases the bug was addressed in TeeChart Pro 7, and as
far as we know they plan to fix the others by their next release. I would
suggest trying TeeChart 7 and see if that helps the issue.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Unfortunately there are no workarounds that we know of as this is a TeeChart
bug. Have you tried using TeeChart Pro 7.0?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Based on your comments, I shelled out the money for TeeChart 7 and see no
difference. Where did you get the information that this had been fixed?
At one point Nard explained the error somewhere, but I don't remember the
details. I can't have users getting an error everytime they close my
program. If I trap the error and don't do anything, how bad of a memory leak
will this cause?
Upgrading to TeeChart 7 will fix the issue in some cases. I'm certain that
if you contacted Steema support, they would have recommended the same.
Below is a copy of an email I sent to Steema and another customer back in
May with the same issue explaining the problem and providing an example that
created the error without the use of ReportBuilder. I promptly received a
reply from Steema thanking me for the example and letting me know that they
would try to resolve the issue by the next maintenance release. If you
would like to see the example I sent, please send an email to
support@digital-metaphors.com and I'll send it to you.
-----
Hi Marjan and Michael,
Sorry this took me so long to research. Testing with TeeChart 7, it is
clear that the free notification of many of the TeeChart components has been
improved. There is however still a small issue with the TeeFuction
notifying components that reference it (i.e. Series) that it has been freed.
The notification seems to work correctly unless the application is being
destroyed. This must be due to the order that the objects are destroyed
when the form is closed. I attached a small example that demonstrates the
problem without using any ReportBuilder components. As you can see by
running the example. If you click the "Create Chart" button, then try to
close the form, an AV occurs. If you run the example again, create the
chart, then free the function and chart (using the given buttons) no AV
occurs. This did cause an AV in TeeChart 6.01 so there is definitely an
improvement here.
The reason this took so long to research is that we were busy trying to
think of a way to work around this in ReportBuilder. Unfortunately the
TComponent.FreeNotification method was fired to late to have any effect on
the problem. If perhaps Borland would have let us override the
TComponent.Destroying method, we might have had a chance. I sincerely hope
you have better luck than we did trying to track down and fix this issue.
-----
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I just had the same problem, with TeeFunction instances which are not
freed correctly, resulting in access violations. My workaround is
simple, if you have the source code of TeeChart (newest Version 7):
In the file TeEngine.pas on line 6548 ff. (function
TChartSeries.Destroy) comment out the "IFDEF CLX".
FreeAndNil(FTeeFunction) is then run on an other condition than before.
Like this, it works for me, but I am not sure if there are pitfalls to
this workaround, nor do I know why there is this IFDEF CLX condition.
Hope could help!
Andreas
Todd schrieb:
Thanks for the tip. I will forward this message to the Steema team at once.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
violations sometime(!). I tracked down hardly and found that it would be
the best workaround, if I destroy all my TppDbChart components in the
data module by myself.
Write an OnDestroy-Handler which frees all your TppDbChart objects,
encapsulated in a try/except block, to catch those nasty access
violations which come from the embedded chart object,and elegantly
ignore them... ;-)
For this to work, you must set the property OldCreateOrder of the
datamodule to True, else your destroy-handler will be to late...
Still a workaround, thow.
Hope could help!
Andreas
Andreas Brodbeck schrieb:
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com