Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsQuestion about "deferred events"
https://www.eclipse.org/forums/index.php/mv/msg/245790/735943/#msg_735943
My SWT application (running on Suse 11) crashed because of a "widget is disposed" problem.
Looking at the code, I didn't see any reason why the widget could be disposed at this point.
Looking at the stack trace, I saw that the original event came from the method "runDeferredEvents" of the Display class.
Does that mean that the original event was "queued" for one or more reasons and when it got processed the attached widget was already disposed ?
If yes, does this mean also that I have to check that every widget "is not disposed" before using it ?
Thanks]]>H.ORTIZ 2011-10-13T07:27:48-00:00Re: Question about "deferred events"
https://www.eclipse.org/forums/index.php/mv/msg/245790/740513/#msg_740513
> reasons and when it got processed the attached widget was already
> disposed ?
Yes, SWT sends some of its events like this in order to improve event
ordering consistency between its platforms. However even a queued event
will not be sent for a disposed widget. I assume that you're receiving
this event from a non-disposed widget, and are then trying to access
another widget that has just become disposed? What type of event are
you receiving? Widget.isDisposed() checks are sometimes needed, but it
should be clear to see why the widget you want to use is disposed (don't
just fall back on an added Widget.isDisposed()). If this varies between
platforms (does it?) then you could be seeing an swt platform inconsistency.