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
How many static constructors are allowed in a class?
Is equal in c#?
Where is c# compiler located?
What are anonymous functions in c#?
Is stringbuilder better than string?
Can a class or a struct have multiple constructors?
What is data dictionary in c#?
What are callback methods in c#?
What is an actual parameter?
How do you sort a list in c#?
What language do desktop applications use?
Why should you override the tostring() method?
What is the difference between ref and out in c#?
What is concatenation and when should it be used?
Explain about ODP.net