فهرست منبع

Destroy cahce in HttpRuntime.Dispose for TARGET_J2EE.

svn path=/trunk/mcs/; revision=47712
Eyal Alalouf 20 سال پیش
والد
کامیت
cc09709c26

+ 8 - 0
mcs/class/System.Web/System.Web.Caching/Cache.cs

@@ -57,6 +57,14 @@ namespace System.Web.Caching {
 			_objExpires = new CacheExpires (this);
 		}
 
+#if TARGET_J2EE
+		internal void Destroy()
+		{
+			_arrEntries = null;
+			_objExpires.Close();
+		}
+#endif
+
 		private IDictionaryEnumerator CreateEnumerator () {
 			Hashtable objTable;
 

+ 8 - 0
mcs/class/System.Web/System.Web.Caching/CacheExpires.cs

@@ -75,6 +75,14 @@ namespace System.Web.Caching {
 			_objTimer = new System.Threading.Timer (new System.Threading.TimerCallback (GarbageCleanup), null, 10000, 60000);
 		}
 
+#if TARGET_J2EE
+		internal void Close()
+		{
+			_arrBuckets = null;
+			_objTimer.Dispose();
+		}
+#endif
+
 		/// <summary>
 		/// Adds a Cache entry to the correct flush bucket.
 		/// </summary>

+ 3 - 0
mcs/class/System.Web/System.Web.Caching/ChangeLog

@@ -1,3 +1,6 @@
+2005-07-26 Eyal Alaluf <[email protected]>
+    * Cache.cs CacheExpires.cs: In TARGET_j2EE dispose the timer thread when done.
+
 2005-07-25 Eyal Alaluf <[email protected]>
     * ExpiresBuckets.cs: Removed unused field (that if used would lead to
 	  serious runtime errors).

+ 3 - 0
mcs/class/System.Web/System.Web/ChangeLog

@@ -1,3 +1,6 @@
+2005-07-26  Eyal Alalouf  <[email protected]>
+	* HttpRuntime.cs: Under TARGET_J2EE dispose the cache as well in Dispose.
+
 2005-07-26 Gonzalo Paniagua Javier <[email protected]>
 
 	* HttpContext.cs: fixed typo when checking for local address. Patch by

+ 3 - 0
mcs/class/System.Web/System.Web/HttpRuntime.cs

@@ -283,6 +283,9 @@ namespace System.Web {
 			if (queueManager != null)
 				queueManager.Dispose (); // Send a 503 to all queued requests
 			queueManager = null;
+#if TARGET_J2EE
+			_cache.Destroy();
+#endif
 			_cache = null;
 			HttpApplicationFactory.EndApplication();
 		}