| Summary: | Calling Display#dispose() during disposal of the display should throw SWT exception | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ralf Sternberg <rsternberg> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 2.0 | ||
| Target Milestone: | 2.0 M2 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Fixed by adding a checkDevice in Display.runDisposeExecs, commit 00c77bd7c2c1c3be175a8d3c4dec538d5955a8c3. |
It's illegal to call Display#dispose() during the disposal of the display (in a dispose listener). In SWT, a "Widget is disposed" exception is thrown in this case. In RWT, this leads to a scary exception as shown below. We should also throw the appropriate SWT exception instead. We could do so by adding a checkDevice() call to Display#release. Current exception: java.lang.NullPointerException at org.eclipse.swt.widgets.Synchronizer.removeFirst(Synchronizer.java:145) at org.eclipse.swt.widgets.Synchronizer.releaseSynchronizer(Synchronizer.java:127) at org.eclipse.swt.widgets.Display.release(Display.java:688) at org.eclipse.swt.graphics.Device.dispose(Device.java:287) ...