Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT crashes with no more handles(SWT crashes with no more handles)
SWT crashes with no more handles [message #1808175] Tue, 18 June 2019 14:18
PASTOR Robert is currently offline PASTOR RobertFriend
Messages: 2
Registered: July 2009
Junior Member
Hello,

Please read the use case :
The use case is a File Explorer, with a recursive access to children files or folders. When the initial entry file has many many children , the recursive access traces the name of the "discovered" file names in a SWT Label and a couple of minutes , the process finishes with the following trace

Infos: ---------- observer received a notification -------------
juin 18, 2019 2:14:46 PM FileExplorerTab.StatusBarObserver update
Infos: xxxxxx file name xxxx.csv
juin 18, 2019 2:14:46 PM FileExplorerTab.StatusBarObserver update
Infos: ---------- observer received a notification -------------
juin 18, 2019 2:14:46 PM FileExplorerTab.StatusBarObserver update
Infos: yyyyyyyyyy file name yyyyyy.conf
Exception in thread "main" org.eclipse.swt.SWTError: No more handles
at org.eclipse.swt.SWT.error(SWT.java:4423)
at org.eclipse.swt.SWT.error(SWT.java:4312)
at org.eclipse.swt.SWT.error(SWT.java:4283)
at org.eclipse.swt.widgets.Widget.error(Widget.java:472)
at org.eclipse.swt.widgets.Control.createHandle(Control.java:704)
at org.eclipse.swt.widgets.Composite.createHandle(Composite.java:307)
at org.eclipse.swt.widgets.Decorations.createHandle(Decorations.java:420)
at org.eclipse.swt.widgets.Shell.createHandle(Shell.java:584)
at org.eclipse.swt.widgets.Control.createWidget(Control.java:744)
at org.eclipse.swt.widgets.Scrollable.createWidget(Scrollable.java:134)
at org.eclipse.swt.widgets.Decorations.createWidget(Decorations.java:428)
at org.eclipse.swt.widgets.Shell.<init>(Shell.java:297)
at org.eclipse.swt.widgets.Shell.<init>(Shell.java:375)
at LiveLinkCore.ShellInformationMessage.init(ShellInformationMessage.java:32)
at LiveLinkCore.ShellInformationMessage.<init>(ShellInformationMessage.java:27)
at FileExplorerTab.FileExplorerTab$6.widgetSelected(FileExplorerTab.java:477)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
at Main.MainMainLiveLinkSwtExplorer.main(MainMainLiveLinkSwtExplorer.java:118)

My query was to get some support / hints on how to be able to catch this SWT exception... perhaps when the number of available handles are near exhausting.

Where should I put this try - catch , please see my main program. It has already a try catch

public static void main(String[] args) {

Display display = new Display ();
try {
// create the shell
final Shell shell = new Shell(display);
try {
shell.setLayout(new FillLayout());
createComposite(shell);

shell.setSize(1200, 700);
shell.open();

while (shell != null && !shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
} finally {
if (!shell.isDisposed()) {
shell.dispose();
}
}
} finally {
display.dispose();
}
System.exit(0);
}

Thanks for your help
Robert
Previous Topic:browser creation silently closes program
Next Topic:ToolTip on Table cells, Linux
Goto Forum:
  


Current Time: Fri Apr 26 17:16:31 GMT 2024

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

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

Back to the top