I have some software I've released where I don't dispose these (note,
MSDN has lots of examples where they create StringFormat instances
without disposing them).
I have changed my software so that future releases will dispose these
objects, but in order to support existing customers, I'm wondering if
anyone knows of symptoms I should watch for from customer problem
reports which might point to the StringFormat not being disposed.
Thanks.
These should not be modified or disposed because this can adversely affect
all the text in the application.
When you create an object from scratch and that object is disposable then
you should call dispose as a matter of course. Microsoft examples often
don't, this has been a bugbear of mine for many years.
If you need to use a modified string format based on one of the standard
ones you should clone, for example, GenericTypeographic, modify it, use it
and dispose of it.
--
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"JS" <jnosp...@gmail.com> wrote in message
news:bef7c956-aeb1-4627...@d21g2000prf.googlegroups.com...
The current release of my software is not disposing some of these
objects -- I am guessing that there could be several thousand
StringFormat objects that I have not released because I found one of
them in the OnPaint of a UserControl that I wrote. I'm not sure how
serious of a problem this is.
--
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"JS" <jnosp...@gmail.com> wrote in message
news:e0e125fd-f916-41ff...@s12g2000prg.googlegroups.com...