Go Back   CP Web Hosting - reseller hosting > Server Scripting > .NET
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-13-2007, 01:01 PM
1R1 1R1 is offline
Senior Member
 
Join Date: Mar 2007
Posts: 164
Default Finalize methods

I've heard that Finalize methods should be avoided. Should I implement Finalize on my class?
Reply With Quote
  #2 (permalink)  
Old 07-13-2007, 01:02 PM
Senior Member
 
Join Date: May 2007
Posts: 151
Default finalize

Actually,An object with a Finalize method is more work for the garbage collector than an object without one. Also there are no guarantees about the order in which objects are Finalized, so there are issues surrounding access to other objects from the Finalize method. Finally, there is no guarantee that a Finalize method will get called on an object, so it should never be relied upon to do clean-up of an object's resources.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0