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

Explain About ADO and its objects

559


What is difference between comparable and comparator?

448


Is lazy thread safe c#?

491


What is array and its types in c#?

515


How does array sort work?

488






the c# keyword .int. Maps to which .net type?

734


Why delegates are type safe in c#?

495


What is desktop application testing?

478


What is a delegate? Explain.

529


how to Create a datagridview control with check box column with 8rows in it, the maximum number of check boxes checked should be 3, when user checks the 4th corresponding message should be displayed and check box should be checked. User can uncheck the checked boxes Note: read-only property should not be used

2383


What is array collection?

483


What does string format do?

463


What are satellite assemblies? How will you get the different language strings?

477


Why data types are important?

515


What is difference between new and override in c#?

445