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() {