Disposed vs Finalize

M

Mike

Hi,

I am calling some unmanaged code from a WebService class and want to ensure
that the resources are released when the WebService class is disposed.

Should I put the cleanup code in the WebServices Disposed event or override
the Finalize method?

Thanks.
 
M

Martin Kulov

Mike said:
Hi,

I am calling some unmanaged code from a WebService class and want to
ensure
that the resources are released when the WebService class is disposed.

Should I put the cleanup code in the WebServices Disposed event or
override
the Finalize method?


Hi Mike,
you should definitely use the Dispose method. This can be a long discussion
so please read something on Dispose pattern in .NET Framework.

Regards,

--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top