From 4b27e761c732bb545df6fd4c62a64970ac5fbe1e Mon Sep 17 00:00:00 2001 From: Robert Davies Date: Wed, 11 Jun 2008 10:54:26 +0000 Subject: [PATCH] Fix for https://issues.apache.org/activemq/browse/AMQ-1790 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@666617 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/broker/region/BaseDestination.java | 6 ++++++ .../main/java/org/apache/activemq/broker/region/Queue.java | 2 +- .../main/java/org/apache/activemq/broker/region/Topic.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/BaseDestination.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/BaseDestination.java index a2d3914a52..9b44f9df81 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/BaseDestination.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/BaseDestination.java @@ -16,6 +16,7 @@ */ package org.apache.activemq.broker.region; +import java.io.IOException; import org.apache.activemq.broker.Broker; import org.apache.activemq.broker.BrokerService; import org.apache.activemq.broker.ConnectionContext; @@ -363,5 +364,10 @@ public abstract class BaseDestination implements Destination { broker.isFull(context,this, usage); } } + + public void dispose(ConnectionContext context) throws IOException { + destinationStatistics.setParent(null); + this.memoryUsage.stop(); + } } diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java index 247b674e96..ba043f780a 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java @@ -479,10 +479,10 @@ public class Queue extends BaseDestination implements Task { } public void dispose(ConnectionContext context) throws IOException { + super.dispose(context); if (store != null) { store.removeAllMessages(context); } - destinationStatistics.setParent(null); } public void gc(){ diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java b/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java index a94f0e7edf..893fad3358 100755 --- a/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java @@ -453,10 +453,10 @@ public class Topic extends BaseDestination implements Task{ } public void dispose(ConnectionContext context) throws IOException { + super.dispose(context); if (topicStore != null) { topicStore.removeAllMessages(context); } - destinationStatistics.setParent(null); } public void gc() {