Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Question about "deferred events"
Question about "deferred events" [message #735943] Thu, 13 October 2011 03:27 Go to next message
H.ORTIZ  is currently offline H.ORTIZ
Messages: 22
Registered: July 2009
Junior Member
Hi,

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
Re: Question about "deferred events" [message #740513 is a reply to message #735943] Tue, 18 October 2011 11:38 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2149
Registered: July 2009
Senior Member
> 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 ?

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.

Grant
Previous Topic:OS X: launcher inside .app
Next Topic:'No more handles' SWT Exception
Goto Forum:
  


Current Time: Sun Aug 31 02:42:06 EDT 2014

Powered by FUDForum. Page generated in 0.09943 seconds