Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2017-06-22 06:29:57 -0400
committerJonah Graham2017-06-22 07:03:34 -0400
commitd8c3c0967d3b1204767534c9b85994b12a47e277 (patch)
tree0cb399bb06f12e9e3bb30ac5a04b465a104f74b7 /dsf-gdb
parentbd4656755c534405ddb9820ed7b707478581e89b (diff)
downloadorg.eclipse.cdt-d8c3c0967d3b1204767534c9b85994b12a47e277.tar.gz
org.eclipse.cdt-d8c3c0967d3b1204767534c9b85994b12a47e277.tar.xz
org.eclipse.cdt-d8c3c0967d3b1204767534c9b85994b12a47e277.zip
Bug 518627: Squelch Device Disposed exception at shutdown
Note, can't simply check isDisposed as that still leaves a race condition between isDisposed call and asyncExec call Change-Id: I3e0e196d9d1dd9b9c8d4048a1aec55405d6dd6e0
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbBasicCliConsole.java10
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsole.java11
2 files changed, 19 insertions, 2 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbBasicCliConsole.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbBasicCliConsole.java
index 86e5418091..1b4684a089 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbBasicCliConsole.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbBasicCliConsole.java
@@ -23,6 +23,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.IConsoleView;
@@ -145,7 +146,14 @@ public class GdbBasicCliConsole extends IOConsole implements IGDBDebuggerConsole
String newName = computeName();
String name = getName();
if (!name.equals(newName)) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(() -> setName(newName));
+ try {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(() -> setName(newName));
+ } catch (SWTException e) {
+ // display may be disposed, so ignore the exception
+ if (e.code != SWT.ERROR_WIDGET_DISPOSED) {
+ throw e;
+ }
+ }
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsole.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsole.java
index 252f0e3a4a..e21fed3260 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsole.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsole.java
@@ -13,6 +13,8 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.AbstractConsole;
import org.eclipse.ui.console.IConsoleView;
@@ -59,7 +61,14 @@ public class GdbFullCliConsole extends AbstractConsole implements IGDBDebuggerCo
String newName = computeName();
String name = getName();
if (!name.equals(newName)) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(() -> setName(newName));
+ try {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(() -> setName(newName));
+ } catch (SWTException e) {
+ // display may be disposed, so ignore the exception
+ if (e.code != SWT.ERROR_WIDGET_DISPOSED) {
+ throw e;
+ }
+ }
}
}

Back to the top