| Summary: | SWT's implementation for UiSynchronize doesn't check for Display device disposal | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Simon Chemouil <eclipse> | ||||||
| Component: | E4 | Assignee: | Simon Chemouil <eclipse> | ||||||
| Status: | ASSIGNED --- | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | remy.suen | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Simon Chemouil
Created attachment 202895 [details]
Patch with Display#isDisposed() check
Works for me, +1 or -1 so I can update and/or commit.
Created attachment 202900 [details]
Patch with Display#isDisposed() check
Added missing copyright entry.
(In reply to comment #0) > If closing your application sends an event that is listened by an @UiEventTopic > annotated method, you will get a SWT error "Device is disposed". I guess this is not an object that's a part of the model? I would expect objects that are part of the model to be disposed (and hence not be injected again). (In reply to comment #3) > I guess this is not an object that's a part of the model? I would expect > objects that are part of the model to be disposed (and hence not be injected > again). It's not in the model per se but it's added to the applicationContext and injected at least to UiEventHandler. And it's not "uninjected" when the display is disposed. It's useless to schedule runnables if the display is disposed, but I agree that it would be nice to find a way "out" from doing the check. Simon, I checked what we do in DisplayRealm and it seems to match what your code does. For the syncExec(Runnable) case, can you check if the current thread's display is actually the display we have and if it is the same to just run the runnable? Otherwise, just queue it as an asynchronous call (and it will be ignored by the disposal check). |