You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2016/03/15 15:53:29 UTC

svn commit: r1735085 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/LRUCache.cs

Author: tabish
Date: Tue Mar 15 14:53:28 2016
New Revision: 1735085

URL: http://svn.apache.org/viewvc?rev=1735085&view=rev
Log:
Apply fix for problems with LRUCache not properly cleaning up after itself.  
Fixes [AMQNET-AMQNET-521]. (See https://issues.apache.org/jira/browse/AMQNET-AMQNET-521)

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/LRUCache.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/LRUCache.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/LRUCache.cs?rev=1735085&r1=1735084&r2=1735085&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/LRUCache.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/LRUCache.cs Tue Mar 15 14:53:28 2016
@@ -47,6 +47,7 @@ namespace Apache.NMS.ActiveMQ.Util
 		public void Clear()
 		{
 			dictionary.Clear();
+            entries.Clear();
 		}
 
         public int Count
@@ -65,12 +66,12 @@ namespace Apache.NMS.ActiveMQ.Util
 			get { return dictionary[key]; }
 			set 
 			{ 
-				TValue currentValue = default (TValue);
+				TValue currentValue;
 				// Moved used item to end of list since it been used again.
 				if (dictionary.TryGetValue(key, out currentValue))
 				{
 					KeyValuePair<TKey, TValue> entry = 
-						new KeyValuePair<TKey, TValue>(key, value);
+                        new KeyValuePair<TKey, TValue>(key, currentValue);
 					entries.Remove(entry);
 				}