Add support for finalizer (normally the class destructor)