[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Runnable in synchExec() never gets started

Hi all,

I have integrated an SWT application with an ActiveX control and am making calls to this via a JavaBean in ORACLE Forms. Everything appears to be ok when I start up the application but all hell breaks loose when i try to shutdown the SWT Application using shell.dispose() from synchExec(). It would appear the runnable never gets called.
Does anyone know a reason for this and is there anything i can do to start that runnable myself and make sure it runs in a timely fashion?


Some of my code snippets are posted below. Is there anything I am doing wrong?

Thank you for your help

Elisha.
......
 private class ShutdownHook implements  Runnable {

public void run() {
myScanner.setStatusMessage("am running the external thread now........");
if (shell != null && !shell.isDisposed()) {
myScanner.setStatusMessage("I am about to dispose of this window & scanner");
shell.dispose();
shell = null;
display.dispose();
display = null;
myScanner = null;
} else {
myScanner.setStatusMessage("The window has been dismissed or i dont have access to it.");
myScanner.setStatusMessage("Doing other application shutdown tasks..");
display.dispose(); display = null; myScanner = null;
}
}
}
....
.....
ShutdownHook shutdown = new ShutdownHook(); Thread mThread = new Thread(shutdown,"SHUTDOWNTHREAD");
myScanner.setStatusMessage("The end is near any moment now"); myScanner.unLoad(); //shell.dispose();
if (display != null && !display.isDisposed()) {
myScanner.setStatusMessage("I am about to dispose of this application");
display.syncExec(shutdown);
mThread.start();
} else {
myScanner.setStatusMessage("U have already disposed of the application here...go Home");
}
.....