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 2017/03/08 23:12:46 UTC

[44/50] [abbrv] activemq-nms-openwire git commit: 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)

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)



Project: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/commit/399c1db2
Tree: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/tree/399c1db2
Diff: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/diff/399c1db2

Branch: refs/heads/1.7.x
Commit: 399c1db2c7f89b4f539219925cc42f12ad10bc9c
Parents: d091a99
Author: Timothy A. Bish <ta...@apache.org>
Authored: Tue Mar 15 14:55:05 2016 +0000
Committer: Timothy A. Bish <ta...@apache.org>
Committed: Tue Mar 15 14:55:05 2016 +0000

----------------------------------------------------------------------
 src/main/csharp/Util/LRUCache.cs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/blob/399c1db2/src/main/csharp/Util/LRUCache.cs
----------------------------------------------------------------------
diff --git a/src/main/csharp/Util/LRUCache.cs b/src/main/csharp/Util/LRUCache.cs
index ec3d7b9..0fcdb90 100644
--- a/src/main/csharp/Util/LRUCache.cs
+++ b/src/main/csharp/Util/LRUCache.cs
@@ -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);
 				}