Merge "Issue #1240 check for null when removing D2DNsharp part listener" into development
Former-commit-id:ce262db463
[formerly bdf886c16679a8049b91fb8323e723ccc098f83b] Former-commit-id:d5b46f2366
This commit is contained in:
commit
fb4821f2ef
1 changed files with 9 additions and 3 deletions
|
@ -29,6 +29,7 @@ import org.eclipse.ui.IViewReference;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
import org.eclipse.ui.IWorkbenchPart;
|
||||||
import org.eclipse.ui.IWorkbenchPartReference;
|
import org.eclipse.ui.IWorkbenchPartReference;
|
||||||
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
import org.eclipse.ui.PartInitException;
|
import org.eclipse.ui.PartInitException;
|
||||||
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
|
@ -90,9 +91,14 @@ public class D2DNSharpPartListener implements IPartListener2 {
|
||||||
VizApp.runAsync(new Runnable() {
|
VizApp.runAsync(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
VizWorkbenchManager.getInstance().getCurrentWindow()
|
IWorkbenchWindow window = VizWorkbenchManager.getInstance()
|
||||||
.getActivePage()
|
.getCurrentWindow();
|
||||||
.removePartListener(D2DNSharpPartListener.this);
|
if (window == null) {
|
||||||
|
// window will be null when CAVE is shutting down
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
IWorkbenchPage page = window.getActivePage();
|
||||||
|
page.removePartListener(D2DNSharpPartListener.this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue