November 9th, 2013, 10:34 AM
Is disposing a local brush variable necessary?
MSDN recommends disposing any variable of type System.Drawing.Brush before its last reference is released. Otherwise, the resources it is using will not be freed until the garbage collector calls the Brush object's Finalize method.
As we know, local variables are destroyed automatically when the control flow goes out of the scope of the method it belongs. So, is it necessary to dispose a brush object every time if it is local?
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!