View Single Post
  #1  
Old 03-13-2008, 02:49 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Destructor Function

I'd like it if there was a destruct() function that would be called before the engine destroys an object whether it be by destroy() or by garbage collection or anything else.

Naturally since its a function the engine would be waiting for destruct() to return before actually destroying the object.

Basically I want to do some cleanup for things that might have objects belonging solely to it.

At the moment I use a System.destroyobject(object/objectname); that is checking if the object exists before calling destroy() and also calling destruct() instead of destroy() where destruct() is cleaning up before destroying the object.
__________________
Reply With Quote