What does dispose() do?
please explain.
thanks
Loading
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.
Sam HobbsPosted Aug 2, 2010, 1:21 PM
In C# and Java objects are clened up using garbage collection. Garbage collection is supposed to make things easier but there are things such as Dispose and Finalize that are really complicated and confusing. Generally speaking, you don't need to implement Dispose for managed objects. Dispose is usually used when there are unmanaged resources that need to be deleted or freed.
Note that your question is very vague; I hve already spent much more time answering than you spent asking. If you want a more specific answer then spend the time to create a more specific question. Also spend time reading relevant articles and other resources.
Tanmay SarkarPosted Aug 2, 2010, 5:37 AM
where destructor() dealocate the alocate memory & it is automatically call by Garbage collector.
I say it from my little knowledge. if any body has better idea/explanation than write it.
Thank you!
All over If it help you please mark it as an answer.
Majid KamaliPosted Aug 2, 2010, 5:16 AM
Is dispose() equivalent to 'delete' keyword in C++ ?
What is difference between dispose() and a destructor ?
Tanmay SarkarPosted Aug 1, 2010, 11:09 PM
http://www.csharphelp.com/2007/05/avoid-c-memory-leaks-with-destructor-and-dispose/
probably you get your answer.
Thank you.
Please mark it as answer if it help you!