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
Can struct inherit from class c#?
If c# destructors are so different to c++ destructors, why did ms use the same syntax?
Why do we use dataset in c#?
Define c# i/o classes? List the commonly used classes?
What are the advantages of using partial classes?
How does insertion sort work?
What is the namespace for datatable in c#?
Is and as keyword in c# net?
What is the difference between struct and class in c#?
Can we inherit a class with private constructor in c#?
Contrast between an interface and abstract class?
How do you declare an arraylist?
What is the difference between constants and read-only?
How main method is called in c#?
What is dependency in software?