How can you clean up objects holding resources from within
the code?
Answers were Sorted based on User's Feedback
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 |
To clean up objects holding resources is to make use of
Dispose Method.
Is This Answer Correct ? | 1 Yes | 0 No |
When static constructor is invoked?
Is c# dictionary a hash table?
What is the lock statement in c#?
What is attribute c#?
Is c# slower than java?
What is difference between string and stringbuilder in c#?
What are the applications of c#?
How do I declare a pure virtual function in c#?
How to achieve polymorphism in c#?
Why is it a bad idea to throw your own exceptions?
What is delegate in c#?
Explain the difference between const and static read-only?