[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: isDisposed() vs. catching SWTException

Fabian,

In general, you should only be interacting directly with a widget on the GUI thread and only the GUI thread should be able to dispose of the widget. You should be able to rely in isDisposed returning true or false properly.


Fabian Zeindl wrote:
Hi,

I keep getting "Widget is already disposed" errors from time to time. I believe it's because threads are updating windows which are already closed or something.

Two questions:

* Is there a common way get around such Exceptions, or does (threading) complexity simply add such errors?
* If the way around is about calling "isDisposed()" on the offending widgets: Can this call be safe? It could return "false" but when I do the operation on the widgets later in the code, it could be disposed meanwhile.


thanks in advance
fabian zeindl