From 5c93171cbcc689fa9255f5f4d1db41d5e3e45ffc Mon Sep 17 00:00:00 2001 From: Bruno Medeiros Date: Wed, 25 Jan 2017 13:28:16 +0000 Subject: [PATCH] Bug 511029 - Debug views become permanently pinned... ... if they are closed and reopened whilst pinned. This was because IPartListener2 was being removed before #partClosed() was called. Change-Id: I16de016387131b775237b5d61639bb32107231fe Signed-off-by: Bruno Medeiros --- .../ui/actions/PinDebugContextActionDelegate.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java index 8cfaa085c61..ec5c5a1286d 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java @@ -145,10 +145,7 @@ public class PinDebugContextActionDelegate implements IViewActionDelegate, IActi public void partClosed(IWorkbenchPartReference partRef) { IWorkbenchPart part = partRef.getPart(false); if (part.equals(fPart)) { - if (fAction.isChecked()) { - DebugEventFilterService.getInstance().removeDebugEventFilter(fPart); - fAction.setChecked(false); - } + unpinPart(); } } @Override @@ -174,6 +171,14 @@ public class PinDebugContextActionDelegate implements IViewActionDelegate, IActi public void dispose() { DebugUITools.removePartDebugContextListener(fPart.getSite(), this); fPart.getSite().getWorkbenchWindow().getPartService().removePartListener(fPartListener); + unpinPart(); + } + + protected void unpinPart() { + if (fAction.isChecked()) { + DebugEventFilterService.getInstance().removeDebugEventFilter(fPart); + fAction.setChecked(false); + } } protected ISelection getActiveDebugContext() {