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 a delegate? Explain.
What is wpf c#?
Write down the c# syntax to catch an exception
What is the difference between string and string in c#?
Why do we use delegates in c#?
How do I create a multilanguage?
What are the variables in c#?
What is expandoobject in c#?
What is interface inheritance?
How many destructors can a class have?
What is the default modifier for class in c#?
How to properly clean up excel interop objects?
Why to use lock statement in c#?
Explain different properties of object oriented systems.
What are the drawbacks of extending an interface as opposed to extending a class?