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:45 UTC
[43/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/37c86bdc
Tree: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/tree/37c86bdc
Diff: http://git-wip-us.apache.org/repos/asf/activemq-nms-openwire/diff/37c86bdc
Branch: refs/heads/master
Commit: 37c86bdc07289cd995a3c4d4ab12992bfafc9da0
Parents: 44f4319
Author: Timothy A. Bish <ta...@apache.org>
Authored: Tue Mar 15 14:53:28 2016 +0000
Committer: Timothy A. Bish <ta...@apache.org>
Committed: Tue Mar 15 14:53:28 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/37c86bdc/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);
}