• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there a destructor method?  RSS feed

 
David M Fairchild
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or some method that is called just before an object is destroyed?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The finalize() method is called before an object is garbage collected. The problem is, though, that there's no guarantee than any given object will ever be collected -- if the memory is never needed, it may not be reclaimed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!