dataFramebuffer.setPixels(0, 0,
sizeFramebuffer, arrayFramebuffer, 0);
- display.asyncExec(new Runnable() {
- @Override
- public void run() {
- imageFramebuffer.dispose();
- imageFramebuffer = new Image(display, dataFramebuffer);
- }
- });
+ if (display.isDisposed() == false) {
+ display.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ imageFramebuffer.dispose();
+ imageFramebuffer = new Image(display, dataFramebuffer);
+ }
+ });
+ }
}
public void stopRequest() {
setColorVM(); /* generate a identity color */
this.keyWindowKeeper = new KeyWindowKeeper(this);
+
+ if (SwtUtil.isMacPlatform() == true) {
+ shell.getDisplay().addListener(SWT.Close, new Listener() {
+ @Override
+ public void handleEvent(Event e) {
+ if (pressedKeyEventList.size() == 1) {
+ KeyEventData data = pressedKeyEventList.get(0);
+ if (data.keycode == SWT.COMMAND && data.stateMask == 0) {
+ logger.info("COMMAND terminated!");
+ EmulatorSkinMain.terminateImmediately(-1);
+ }
+ }
+ }
+ });
+ }
}
public void setCommunicator(SocketCommunicator communicator) {
logger.info("activate");
if (SwtUtil.isMacPlatform() == true) {
- parent.moveAbove(shell);
+ if (parent.isDisposed() == false) {
+ parent.moveAbove(shell);
+ }
} else {
shell.getDisplay().asyncExec(new Runnable() {
@Override
logger.info("activate");
if (SwtUtil.isMacPlatform() == true) {
- parent.moveAbove(shell);
+ if (parent.isDisposed() == false) {
+ parent.moveAbove(shell);
+ }
} else {
shell.getDisplay().asyncExec(new Runnable() {
@Override