When we are implementing a Dispose method in my application then it releases unmanaged resource used by my application. The .NET Framework garbage collector does not allocate or release unmanaged memory.
The pattern for disposing an object, referred to as a dispose pattern, imposes order on the lifetime of an object. The dispose pattern is used only for objects that access unmanaged resources, such as file and pipe handles, registry handles, wait handles, or pointers to blocks of unmanaged memory. This is because the garbage collector is very efficient at reclaiming unused managed objects, but it is unable to reclaim unmanaged objects.
Liked By
Write Answer
What is purpose of dispose method
Join MindStick Community
You have need login or register for voting of answers or question.
John Smith
11-Feb-2016When we are implementing a Dispose method in my application then it releases unmanaged resource used by my application. The .NET Framework garbage collector does not allocate or release unmanaged memory.
The pattern for disposing an object, referred to as a dispose pattern, imposes order on the lifetime of an object. The dispose pattern is used only for objects that access unmanaged resources, such as file and pipe handles, registry handles, wait handles, or pointers to blocks of unmanaged memory. This is because the garbage collector is very efficient at reclaiming unused managed objects, but it is unable to reclaim unmanaged objects.