View Single Post
  #110 (permalink)  
Old 11-17-2009, 01:59 PM
agraham's Avatar
agraham agraham is offline
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by corwin42 View Post
Am I right that this is normally not a problem (because the GC will handle this)
Yes, normally you should let the GC do its' job.
Quote:
but it's a bad idea for objects that use unmanaged memory or implement IDisposable?
It's only really a problem for things like (and it's the only example I can think of) Bitmaps where the ratio of unmanaged memory used by the underlying native object is very large in relation to the small amount of managed memory used to encapsulate it for .NET use. Before reusing the same object name the only things other than Bitmap and BitmapEx that I would rooutinely Dispose would be Drawer andDrawerEx that are really GDI Graphics objects.

If you don't have problems I would not worry about memory use or using Dispose.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote