diff --git a/activemq-broker/src/main/java/org/apache/activemq/transport/vm/VMTransport.java b/activemq-broker/src/main/java/org/apache/activemq/transport/vm/VMTransport.java index ba6ed138e0..ef1b1e2d0f 100755 --- a/activemq-broker/src/main/java/org/apache/activemq/transport/vm/VMTransport.java +++ b/activemq-broker/src/main/java/org/apache/activemq/transport/vm/VMTransport.java @@ -171,7 +171,7 @@ public class VMTransport implements Transport, Task { public void stop() throws Exception { // Only need to do this once, all future oneway calls will now // fail as will any asnyc jobs in the task runner. - if (disposed.compareAndSet(false, true)) { + if (disposed.compareAndSet(false, true) && started.get()) { TaskRunner tr = taskRunner; LinkedBlockingQueue mq = this.messageQueue;