From b835ce6ee38fdf3783e0fd80caf1bad2b6395df2 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Tue, 12 Jul 2011 13:57:22 +0000 Subject: [PATCH] [351759] [shells] need to check for disposed widget when handling events --- .../ui/view/SystemCommandsViewPart.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java index fee33f4278a..1d2592609a6 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/SystemCommandsViewPart.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2002, 2009 IBM Corporation and others. All rights reserved. + * Copyright (c) 2002, 2011 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the terms * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -20,6 +20,7 @@ * Kevin Doyle (IBM) - [198534] Shell Menu Enablement Issue's * Radoslav Gerganov (ProSyst) - [181563] Fix hardcoded Ctrl+Space for remote shell content assist * David McKnight (IBM) - [294398] [shells] SystemCommandsViewPart always assumes systemResourceChanged() called on Display thread + * David McKnight (IBM) - [351759] [shells] need to check for disposed widget when handling events ********************************************************************************/ package org.eclipse.rse.internal.shells.ui.view; @@ -772,8 +773,10 @@ public class SystemCommandsViewPart final IRemoteCommandShell fsource = (IRemoteCommandShell)source; Display.getDefault().asyncExec(new Runnable() { public void run() { - updateOutput(fsource, false); - updateActionStates(); + if (!_folder.isDisposed()){//make sure view isn't disposed + updateOutput(fsource, false); + updateActionStates(); + } } }); } @@ -796,9 +799,11 @@ public class SystemCommandsViewPart final IRemoteCommandShell fsource = (IRemoteCommandShell)source; Display.getDefault().asyncExec(new Runnable() { public void run() { - updateOutput(fsource, false); - _folder.remove(fsource); - updateActionStates(); + if (!_folder.isDisposed()){//make sure view isn't disposed + updateOutput(fsource, false); + _folder.remove(fsource); + updateActionStates(); + } } }); } @@ -816,7 +821,9 @@ public class SystemCommandsViewPart final IRemoteCommandShell fsource = (IRemoteCommandShell)parent; Display.getDefault().asyncExec(new Runnable() { public void run() { - updateOutput(fsource, false); + if (!_folder.isDisposed()){//make sure view isn't disposed + updateOutput(fsource, false); + } } }); }