public void Dispose() { if (disposed) { return; } PlatformServices.RemoveEventHandler(eventDomain); screen_stop_events(handle); screen_destroy_context(handle); RemoveInstance(type); disposed = true; }