Objects normailly do not need to be disposed unless they have resources or
referencess to other objects that have unmanaged resources that need to be
disposed (file handles, bitmaps, network streams, sockets, connections, etc.)
If your object has a Dispose method, you can call it, or have your class
implement the IDisposable pattern and it can call it.
Otherwise, objects are destroyed automatically by the runtime and in the
case of an ASP.NET page, everything goes away anyway as soon as the page
lifecycle is complete and the HTML has been sent out to the browser.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"mu*********@gmail.com" wrote:
Hello there,
Is it compulsory that the component objects created in code behind
should be disposed explicitly.
For eg.
first.cs
index.aspx.cs
-----------------------------------------------------
-----------------------------------------------------
Class first first
objFirst = new first();
{
page_load()
method A () {some code} {
}
objFirst.A();
}
in the above example is it nessesary to dispose "objFirst" object.
Anticipating your reply.
Thanx in advance.