How to destroy an object?
How to destroy an object?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jul 9, 2013, 12:05 PM
Alternatively, you can force an immediate garbage collection by calling GC.Collect().
Sanjeeb LenkaPosted Jul 9, 2013, 11:45 AM
http://www.codeproject.com/Articles/7792/Destructors-in-C
Iftikar HussainPosted Jul 9, 2013, 11:43 AM
If an object has a Dispose() method, you need to call it before it goes out of scope. You can use the using keyword to do this for you automatically
Regards,
Iftikar