}
if (graphics != null) {
graphics.close();
}
final FrameBufferAPI savedApi = this.api;
this.api = null;
this.graphics = null;
this.keyboardHandler = null;
this.mouseHandler = null;
// Shutdown the eventqueue as the last event
final JNodeEventQueue eventQueue = this._eventQueue;
if (eventQueue != null) {
EventQueue.invokeLater(new Runnable() {
public void run() {
eventQueue.shutdown();
}
});
}
synchronized (initCloseLock) {
this.refCount = 0;
graphicsMode = false;
initCloseLock.notifyAll();
}
savedApi.releaseOwnership(this);
return 0;
} else {
return rc;
}
}