You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2011/01/20 17:11:30 UTC

svn commit: r1061365 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java

Author: dejanb
Date: Thu Jan 20 16:11:29 2011
New Revision: 1061365

URL: http://svn.apache.org/viewvc?rev=1061365&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3038 - delete temp destinations when connection is closed

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java?rev=1061365&r1=1061364&r2=1061365&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQConnection.java Thu Jan 20 16:11:29 2011
@@ -643,6 +643,14 @@ public class ActiveMQConnection implemen
                         c.dispose();
                     }
 
+                    // As TemporaryQueue and TemporaryTopic instances are bound
+                    // to a connection we should just delete them after the connection
+                    // is closed to free up memory
+                    for (Iterator<ActiveMQTempDestination> i = this.activeTempDestinations.values().iterator(); i.hasNext();) {
+                        ActiveMQTempDestination c = i.next();
+                        c.delete();
+                    }
+                    
                     if (isConnectionInfoSentToBroker) {
                         // If we announced ourselfs to the broker.. Try to let
                         // the broker