int detach([bool keepAlive = false]) { if (keepAlive) return nativeFunction; registry.remove(this); dispose(); return nativeFunction; }