activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1073125 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
Date Mon, 21 Feb 2011 20:04:06 GMT
Author: chirino
Date: Mon Feb 21 20:04:06 2011
New Revision: 1073125

URL: http://svn.apache.org/viewvc?rev=1073125&view=rev
Log:
Fixes producer memory leak.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala?rev=1073125&r1=1073124&r2=1073125&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
Mon Feb 21 20:04:06 2011
@@ -242,8 +242,7 @@ class LocalRouter(val host:VirtualHost) 
     }
 
     def connect(path:Path, destination:DestinationDTO, producer:BindableDeliveryProducer,
security:SecurityContext):Unit = {
-      var matches = get_destination_matches(path)
-      matches.foreach { dest=>
+      get_destination_matches(path).foreach { dest=>
         if( dest.can_connect(destination, producer, security) ) {
           dest.connect(destination, producer)
         }
@@ -253,10 +252,10 @@ class LocalRouter(val host:VirtualHost) 
 
     def disconnect(destination:DestinationDTO, producer:BindableDeliveryProducer) = {
       val path = DestinationParser.decode_path(destination.name)
+      producers_by_path.remove(path, new ProducerContext(destination, producer, null))
       get_destination_matches(path).foreach { dest=>
         dest.disconnect(producer)
       }
-      producer.release
     }
 
   }



Mime
View raw message