lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r947760 - /lucene/lucene.net/tags/Lucene.Net_2_9_2/src/Lucene.Net/Util/CloseableThreadLocal.cs
Date Mon, 24 May 2010 18:47:55 GMT
Author: digy
Date: Mon May 24 18:47:54 2010
New Revision: 947760

URL: http://svn.apache.org/viewvc?rev=947760&view=rev
Log:
LUCENENET-358 CloseableThreadLocal memory leak in LocalDataStoreSlot (with workaround) [Tag
2.9.2]

Modified:
    lucene/lucene.net/tags/Lucene.Net_2_9_2/src/Lucene.Net/Util/CloseableThreadLocal.cs

Modified: lucene/lucene.net/tags/Lucene.Net_2_9_2/src/Lucene.Net/Util/CloseableThreadLocal.cs
URL: http://svn.apache.org/viewvc/lucene/lucene.net/tags/Lucene.Net_2_9_2/src/Lucene.Net/Util/CloseableThreadLocal.cs?rev=947760&r1=947759&r2=947760&view=diff
==============================================================================
--- lucene/lucene.net/tags/Lucene.Net_2_9_2/src/Lucene.Net/Util/CloseableThreadLocal.cs (original)
+++ lucene/lucene.net/tags/Lucene.Net_2_9_2/src/Lucene.Net/Util/CloseableThreadLocal.cs Mon
May 24 18:47:54 2010
@@ -45,7 +45,7 @@ namespace Lucene.Net.Util
 	{
 		
 		[ThreadStatic]
-		static System.Collections.Generic.Dictionary<object, object> slots;
+        static SupportClass.WeakHashTable slots;
 		
 		public /*protected internal*/ virtual System.Object InitialValue()
 		{
@@ -65,9 +65,9 @@ namespace Lucene.Net.Util
                 return value;
             }
 
-            if (slots.TryGetValue(this, out value))
+            if (slots.ContainsKey(this))
             {
-                return value;
+                return slots[this];
             }
             else
             {
@@ -79,8 +79,8 @@ namespace Lucene.Net.Util
 		
 		public virtual void  Set(System.Object object_Renamed)
 		{
-			if (slots == null)
-				slots = new System.Collections.Generic.Dictionary<object, object>();
+            if (slots == null)
+                slots = new SupportClass.WeakHashTable();
 
 			slots[this] = object_Renamed;	
 		}



Mime
View raw message