diff options
author | Andrey Loskutov | 2018-10-18 09:19:01 +0000 |
---|---|---|
committer | Andrey Loskutov | 2018-10-18 09:19:01 +0000 |
commit | 024978ca0eb7ef7c46a1c561e2f09a047c49643f (patch) | |
tree | 1da1a201e457b453501b57b69bad237da752539b /org.eclipse.debug.ui | |
parent | 8145992a4908a842ad58791594bbd8b5811dbc4f (diff) | |
download | eclipse.platform.debug-024978ca0eb7ef7c46a1c561e2f09a047c49643f.tar.gz eclipse.platform.debug-024978ca0eb7ef7c46a1c561e2f09a047c49643f.tar.xz eclipse.platform.debug-024978ca0eb7ef7c46a1c561e2f09a047c49643f.zip |
Bug 540242 - SWTException in InternalTreeModelViewer.getDisplay
ElementMementoRequest should not try to call done() on already disposed
viewer
Change-Id: I09276f7f001a4c1725519183ee1a05d8485c6fb2
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.debug.ui')
2 files changed, 11 insertions, 13 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java index 08d25f392..6bbcfb24f 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java @@ -18,6 +18,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRe import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer; import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; import org.eclipse.jface.viewers.TreePath; +import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IMemento; /** @@ -45,23 +46,20 @@ class ElementMementoRequest extends MementoUpdate implements IElementMementoRequ fDelta = delta; } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IProgressMonitor#done() - */ @Override public void done() { - ITreeModelViewer viewer = getContentProvider().getViewer(); - if (viewer == null) - { - return; // disposed + if (viewer == null) { + return; // disposed } - if (viewer.getDisplay().getThread() == Thread.currentThread()) { - doComplete(); - } else { - viewer.getDisplay().asyncExec(() -> doComplete()); + Display display = viewer.getDisplay(); + if (display != null) { + if (display.getThread() == Thread.currentThread()) { + doComplete(); + } else { + display.asyncExec(this::doComplete); + } } - } private void doComplete() { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java index b5ef7ce09..b6fab9a4b 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java @@ -1424,7 +1424,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree @Override public Display getDisplay() { Control control = getControl(); - if (control != null) { + if (control != null && !control.isDisposed()) { return control.getDisplay(); } return null; |