Disposing of TChart on Net 6

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Brian
Newbie
Newbie
Posts: 7
Joined: Wed Jan 22, 2020 12:00 am

Disposing of TChart on Net 6

Post by Brian » Wed Aug 03, 2022 3:23 am

Hi,

I apologize for posting a reply to your announcement message because I did not see the "New Topic" button. Your reply on the thread https://www.steema.com/support/viewtopi ... 703#p78724 worked on the base TChart controls, but failed on our controls that inherit from TChart.

Upon further checking, we had the line below that seems to raise the NullReferenceException on Dispose.
tChart1.Graphics3D.BufferStyle = Steema.TeeChart.Drawing.BufferStyle.DoubleBuffer;

This line was inserted to resolve an issue we encountered 9 years ago - http://www.teechart.net/support/viewtop ... 156#p62249.

Do we still need the line to set the BufferStyle?

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Disposing of TChart on Net 6

Post by Marc » Wed Aug 03, 2022 11:23 am

Hello,

No; if that works ok for you that's fine, ignore my recommendation. I've made a note of the issue I encountered as it may affect other projects with a different buffer setting.

Regards,
Marc
Steema Support

Brian
Newbie
Newbie
Posts: 7
Joined: Wed Jan 22, 2020 12:00 am

Re: Disposing of TChart on Net 6

Post by Brian » Thu Aug 04, 2022 4:15 am

Thank you for the prompt reply.

Your recommendation (to generate the bitmap) is still required when we generate and dispose of TCharts that are not shown to the user. As it turns out though, we needed to generate the bitmap before setting the bufferStyle to avoid the NullReferenceException. Thank you for the assistance.

Dim x As New Steema.TeeChart.TChart
x.Bitmap(20, 20)
x.Graphics3D.BufferStyle = Steema.TeeChart.Drawing.BufferStyle.DoubleBuffer
x.Dispose()

Post Reply