Is there any solution for destroying current instance of object in itself ?
I am looking for something which looks like:
class KillMe { .... pub
The object doesn't have access to the references to it so there's no way to set them to null or something else. An object can only be "destroyed" when the garbage collector comes around and clears out all unreferenced objects.
null
That being said, try this:
public void destroy() { System.exit( 0 ); }