Archive

Posts Tagged ‘Stability’

Code Issues – Undisposed local

July 13th, 2011 Comments off

The Undisposed local code issue of the warning type highlights local variables that implement the System.IDisposable interface and are not explicitly disposed. The IDisposable interface was designed to provide a standard way to release unmanaged resources by calling its Dispose method. If the object is IDisposable, it is a good idea to dispose of it when you no longer need it, especially if the object uses unmanaged resources. These are resources that the .NET garbage collector does not manage on our behalf and is unable to clean-up automatically. They include items such as streams, files, database connections, handles and other operating system objects. If the memory and system resources that they use are not properly released, a program may suffer from memory leaks or problems due to locked resources.

Read more…