1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 412949 - Double clicking in Disassembly leaks a listener

This commit is contained in:
Anton Leherbauer 2013-07-15 13:26:49 +02:00
parent f33ded195a
commit 8b12c2d474

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2009 Wind River Systems, Inc. and others. * Copyright (c) 2009, 2013 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -38,16 +38,20 @@ public class RulerToggleBreakpointHandler extends AbstractHandler {
final IVerticalRulerInfo rulerInfo= (IVerticalRulerInfo) part.getAdapter(IVerticalRulerInfo.class); final IVerticalRulerInfo rulerInfo= (IVerticalRulerInfo) part.getAdapter(IVerticalRulerInfo.class);
if (rulerInfo != null) { if (rulerInfo != null) {
final ToggleBreakpointAction toggleBpAction= new ToggleBreakpointAction(part, document, rulerInfo); final ToggleBreakpointAction toggleBpAction= new ToggleBreakpointAction(part, document, rulerInfo);
toggleBpAction.update(); try {
if (toggleBpAction.isEnabled()) { toggleBpAction.update();
if (event.getTrigger() instanceof Event) { if (toggleBpAction.isEnabled()) {
// Pass through the event that triggered the action. if (event.getTrigger() instanceof Event) {
// This will give toggle action access to key modifiers // Pass through the event that triggered the action.
// (shift, ctrl, etc.) // This will give toggle action access to key modifiers
toggleBpAction.runWithEvent((Event)event.getTrigger()); // (shift, ctrl, etc.)
} else { toggleBpAction.runWithEvent((Event)event.getTrigger());
toggleBpAction.run(); } else {
} toggleBpAction.run();
}
}
} finally {
toggleBpAction.dispose();
} }
} }
} }