dispose() throwing exception?
Hi,
I have an application that runs on several handhelds. We are using the J9 runtime and the personal profile, and developing with eclipse.
Some of our devices are running Pocket PC 4.2. No problem there - the problems I describe below don't occur. However, one of our devices is running Windows CE 5. On this device, when I call dispose() on our frame, I'm getting the following exception stack trace:
Exception caught in event loop: java.lang.NullPointerException; event loop continuing ... java.lang.NullPointerException at org.eclipse.swt.widgets.Menu.releaseWidget(Unknown Source) at org.eclipse.swt.widgets.Widget.dispose(Unknown Source) at java.awt.MenuComponent._removeNotify(Unknown Source) at java.awt.MenuBar._removeNotify(Unknown Source) at java.awt.Frame._cleanUpShell(Unknown Source) at java.awt.Frame._removeNotify(Unknown Source) at java.awt.Component$RemoveNotifyRunnable.run(Unknown Source) at org.eclipse.swt.widgets.RunnableLock.run(Unknown Source) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.runAsyncMessages(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at java.awt.BBToolkit.start(Unknown Source) at java.awt.BBToolkit$4.run(Unknown Source)
This is causing a problem, because when our application starts, we have native code that looks for an application window that already exists, and displays it (so we only get one instance running). But since dispose() is bugging out, the native code actually finds the leftovers of the previous window, but then can't display it - so the user can't open the app, and they have to soft-reset between runs of the app.
Oddly, using j9.exe throws the above exception, but must do some extra cleanup, because I can run the app again w/o a soft reset. But, I'd rather use j9w so my users don't have to see the java console.
Has anyone seen anything like this? Not exactly sure what I can do to prevent this from happening....maybe a native call to DestroyWindow would work...
Thanks,
Matt

