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.