From b56b76df66510f965d07b6c801df1847f24811bc Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Wed, 17 Jan 2018 11:37:56 +0000 Subject: [PATCH] Bug 529762 - [launchbar] "widget is disposed" sometimes at startup Additional isDisposed checks added to prevent unhandled event loop exceptions at platform startup on new workspaces. Change-Id: Ib2e33def766c23719e483496d110644a2cd8a712 Signed-off-by: Mat Booth --- .../ui/controls/internal/LaunchBarControl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java index 960ae5fdf4d..7b6e5b7ca61 100644 --- a/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java +++ b/bundles/org.eclipse.launchbar.ui.controls/src/org/eclipse/launchbar/ui/controls/internal/LaunchBarControl.java @@ -182,6 +182,10 @@ public class LaunchBarControl implements ILaunchBarListener { @Override public void activeLaunchDescriptorChanged(ILaunchDescriptor descriptor) { + if (container == null || container.isDisposed()) { + return; + } + container.getDisplay().asyncExec(() -> { if (configSelector != null) { configSelector.setDelayedSelection(descriptor, SELECTION_DELAY); @@ -191,13 +195,19 @@ public class LaunchBarControl implements ILaunchBarListener { if (targetSelector == null || targetSelector.isDisposed()) { createTargetSelector(); syncSelectors(); - container.getParent().layout(true); + if (!container.isDisposed()) { + Composite parent = container.getParent(); + parent.layout(true); + } } } else { if (targetSelector != null && !targetSelector.isDisposed()) { onLabel.dispose(); targetSelector.dispose(); - container.getParent().layout(true); + if (!container.isDisposed()) { + Composite parent = container.getParent(); + parent.layout(true); + } } } });