How can you clean up objects holding resources from within
the code?
Answer Posted / nagasaichand
The recommended practice is to implement both Finalize as
well as Dispose methods on an object which needs to clean up
unmanaged resources. The Finalize method would serve as a
backup mechanism in the event that the Dispose is never
called. The garbage collector would perform the object
finalization and prevent a permanent leak of the unmanaged
resource.
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is windows application in c#?
What is gac? What are the steps to create an assembly and add it to the gac?
Illustrate race condition?
How do I simulate optional parameters to com calls?
What is difference between an Structure and Class?
What is marshalling and what are different kinds of marshalling?
So let's say I have an application that uses myapp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name myapp.dll 1.1.0.0. How do I tell the client applications that are already installed to start using this new myapp.dll?
What is the difference between system.string and system.text.stringbuilder classes?
Define thread?
What type is string in c#?
Explain the difference between boxing and unboxing.
How to implement an object pool in c#.net.
What is the difference between ienumerable and icollection?
Can you see a loop recorder?
What does immutable mean in c#?