Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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


Please Help Members By Posting Answers For Below Questions

What is the main usage of keyword “virtual” ? How does it work for a method or property?

328


What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?

381


Explain the difference between access specifier and access modifier in c#?

285


Does c# have its own class library?

341


Does c# replace c++?

375






What does out mean in c#?

298


What is anonymous methods in c#?

298


Are attributes inherited c#?

279


What is remote data?

288


What is a linked list c#?

298


What is asynccallback c#?

307


How many variables do you need?

296


Hi to all..I have to create an intranet application on C#.NET windows Application so please please let can you people help me as iam new in .NET and if u have any samples or website address from where i can get sample please let know.

3594


Are tuples immutable c#?

297


Explain partial class in c#?

308