Community
Participate
Working Groups
Build Identifier: 1.5.0.20110720-0846 I've started using ProgressMonitorDialogs to give user feedback to long running operations. This was going great until we started running out of memory. I've found that if a user closes their browser while a progress dialog is open its ModalContextThread will never terminate. It is stuck in a display.syncExec. It looks like a syncExec call will never return after the display is disposed of. The caller sits in a while(!lock.done()) lock.wait() Interrupting the thread won't even break it out as the exception is caught and not dealt with until after lock.done() == true The ModalContextThread holds references to the Display (and from there, all widgets, etc...) and UIThread, stopping them from being garbage collected as being a Thread it is a GC root. It is also impossible to hack around this as the only reference left to the RunnableLock after the Display is disposed is on a stack frame inside a method. Currently the only fix I can think of is setting a Throwable to all the current runnable locks and notifying them when a display is disposed. That would propagate the throwable to the caller of syncExec (wrapped in an SWTException) Reproducible: Always Steps to Reproduce: 1. Create a ModalContext via new ProgressMonitorDialog(...) 2. Dispose of Display before the ModalContextThread finishes 3. ModalContextThread will never terminate
For me this bug sounds like a duplicate of Bug 352437, which has been fixed in CVS HEAD and v14_Maintenance branch. Please give the latest nightly build a try and report it back. The patch applied is attached to the bug as well.
(In reply to comment #1) > For me this bug sounds like a duplicate of Bug 352437 Sorry, should have looked harder in the existing bugs
(In reply to comment #2) Closed as duplicate. *** This bug has been marked as a duplicate of bug 352437 ***