From 1de4e83823b549069119fb7179de07303b7bf8c1 Mon Sep 17 00:00:00 2001 From: Pawel Piech Date: Mon, 12 May 2008 22:36:29 +0000 Subject: [PATCH] [231686] - [commands] AbstractMIControl.stopCommandProcessing() can throw exceptions if called twice. --- .../org/eclipse/dd/mi/service/command/AbstractMIControl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java index 24ebcec332f..19cbe474190 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/AbstractMIControl.java @@ -144,6 +144,9 @@ public abstract class AbstractMIControl extends AbstractDsfService } protected void stopCommandProcessing() { + // Guard against calling this multiple times (e.g. as a result of a + // user request and an event from the back end). + if (fStoppedCommandProcessing) return; fStoppedCommandProcessing = true; /* @@ -154,6 +157,7 @@ public abstract class AbstractMIControl extends AbstractDsfService commandHandle.getRequestMonitor().setStatus(genStatus("Connection is shut down")); //$NON-NLS-1$ commandHandle.getRequestMonitor().done(); } + fCommandQueue.clear(); /* * Now go through the commands which are outstanding in that they have been sent to the backend.