Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » 'No more handles' SWT Exception
'No more handles' SWT Exception [message #437056] Fri, 28 May 2004 08:26 Go to next message
Eclipse UserFriend
Originally posted by: cbr.teamlog.com

Does anybody could tell me what this exception means :

org.eclipse.swt.SWTError: No more handles

Thanks for feedbacks,

-MaRc
Re: 'No more handles' SWT Exception [message #437057 is a reply to message #437056] Fri, 28 May 2004 09:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: v.j.b

> org.eclipse.swt.SWTError: No more handles

it is most likely that you are using some of the painting functions of SWT,
or some objects like Colors, Images, etc, that you _yourself_ need to
dispose of when no longer used. So, after you're finished with them, call
(objectname).dispose().

The handles are the id's used by the operating system to refer to resources
such as images and windows. In SWT it is obligatory to dispose of those
yourself, instead of relying on the garbage collector (which does not know
of any os resources, afaik).
Re: 'No more handles' SWT Exception [message #437060 is a reply to message #437057] Fri, 28 May 2004 10:16 Go to previous messageGo to next message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
In addition that error may occur when using browser widget or the printer
class on Linux.

> > org.eclipse.swt.SWTError: No more handles

> it is most likely that you are using some of the painting functions of SWT,
> or some objects like Colors, Images, etc, that you _yourself_ need to
> dispose of when no longer used. So, after you're finished with them, call
> (objectname).dispose().

> The handles are the id's used by the operating system to refer to resources
> such as images and windows. In SWT it is obligatory to dispose of those
> yourself, instead of relying on the garbage collector (which does not know
> of any os resources, afaik).
Re: 'No more handles' SWT Exception [message #740284 is a reply to message #437056] Tue, 18 October 2011 10:44 Go to previous messageGo to next message
Kees Pieters is currently offline Kees PietersFriend
Messages: 24
Registered: July 2009
Junior Member
This problem can also occur if you perform an intensive ui update operation, such as expanding a tree view. As you delegate the update to the ui thread, it becomes easier to call the, for instance 'expandall' function multiple times, with the risk that the tree is busy with expanding when it gets the following call to do so, etc. It may be wise to prevent this from happening by either introducing a boolean 'updating' to prevent consecutive calls from performing an expand if the thread is busy, or use other means of slowing down the expand calls (e.g. in a separate thread) .

I had this happening when we wanted to visualise a process, with the expand option, but as the process was so fase, the GUI could not keep up
Re: 'No more handles' SWT Exception [message #741723 is a reply to message #740284] Wed, 19 October 2011 20:50 Go to previous message
svic4ever is currently offline svic4everFriend
Messages: 7
Registered: October 2011
Junior Member
You can try this link http: //webcache.googleusercontent.com/search?q=cache:Q2k_tpP_UrEJ:i-proving.ca/space/David%2BJones/blog/2006-06-05_1+/search%3Fhl%3Den%26client%3Dfirefox-a%26hs%3D3SZ%26rls%3Dorg.mozilla:en-GB:official%26q%3D%2Bsite:i-proving.ca%2BDiagnosing%2BHandle%2BLeaks%2Bin%2BSWT/RCP%2BWindows%2BApplications&cd=1&hl=en&ct=clnk
The link may be old but it's informative.
Previous Topic:Question about "deferred events"
Next Topic:How to add a separator between two tree items
Goto Forum:
  


Current Time: Sun Dec 21 02:37:49 GMT 2014

Powered by FUDForum. Page generated in 0.01649 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software