Author: juraj
Date: 2007-06-25 13:11:48 -0400 (Mon, 25 Jun 2007)
New Revision: 80696
Modified:
trunk/mcs/class/System.Web/System.Web.Caching/Cache.cs
trunk/mcs/class/System.Web/System.Web.Caching/ChangeLog
trunk/mcs/class/System.Web/System.Web/ChangeLog
trunk/mcs/class/System.Web/System.Web/HttpRuntime.cs
Log:
2007-06-25 Juraj Skripsky <[EMAIL PROTECTED]>
* Cache.cs: Re-introduce "InvokePrivateCallbacks" accidentally
removed in r80321.
2007-06-25 Juraj Skripsky <[EMAIL PROTECTED]>
* HttpRuntime.cs (ShutdownAppDomain): Re-introduce call to
"Cache.InvokePrivateCallbacks".
Modified: trunk/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web/ChangeLog 2007-06-25 16:58:36 UTC
(rev 80695)
+++ trunk/mcs/class/System.Web/System.Web/ChangeLog 2007-06-25 17:11:48 UTC
(rev 80696)
@@ -1,3 +1,8 @@
+2007-06-25 Juraj Skripsky <[EMAIL PROTECTED]>
+
+ * HttpRuntime.cs (ShutdownAppDomain): Re-introduce call to
+ "Cache.InvokePrivateCallbacks".
+
2007-06-24 Vladimir Krasnov <[EMAIL PROTECTED]>
* HttpUtility.cs: fixed HtmlAttributeEncode, performance improvement
Modified: trunk/mcs/class/System.Web/System.Web/HttpRuntime.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpRuntime.cs 2007-06-25
16:58:36 UTC (rev 80695)
+++ trunk/mcs/class/System.Web/System.Web/HttpRuntime.cs 2007-06-25
17:11:48 UTC (rev 80696)
@@ -383,6 +383,8 @@
static void ShutdownAppDomain (object args)
{
queue_manager.Dispose ();
+ // This will call Session_End if needed.
+ InternalCache.InvokePrivateCallbacks ();
// Kill our application.
HttpApplicationFactory.Dispose ();
ThreadPool.QueueUserWorkItem (new WaitCallback
(DoUnload), null);
Modified: trunk/mcs/class/System.Web/System.Web.Caching/Cache.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Caching/Cache.cs 2007-06-25
16:58:36 UTC (rev 80695)
+++ trunk/mcs/class/System.Web/System.Web.Caching/Cache.cs 2007-06-25
17:11:48 UTC (rev 80696)
@@ -210,6 +210,31 @@
}
}
+ // Used when shutting down the application so that
+ // session_end events are sent for all sessions.
+ internal void InvokePrivateCallbacks ()
+ {
+ CacheItemRemovedReason reason =
CacheItemRemovedReason.Removed;
+ lock (cache) {
+ foreach (string key in cache.Keys) {
+ CacheItem item;
+#if NET_2_0
+ cache.TryGetValue (key, out item);
+#else
+ item = (CacheItem) cache [key];
+#endif
+
+ if (item != null &&
item.OnRemoveCallback != null) {
+ try {
+ item.OnRemoveCallback
(key, item.Value, reason);
+ } catch {
+ //TODO: anything to be
done here?
+ }
+ }
+ }
+ }
+ }
+
public IDictionaryEnumerator GetEnumerator ()
{
ArrayList list = new ArrayList ();
Modified: trunk/mcs/class/System.Web/System.Web.Caching/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Caching/ChangeLog 2007-06-25
16:58:36 UTC (rev 80695)
+++ trunk/mcs/class/System.Web/System.Web.Caching/ChangeLog 2007-06-25
17:11:48 UTC (rev 80696)
@@ -1,3 +1,8 @@
+2007-06-25 Juraj Skripsky <[EMAIL PROTECTED]>
+
+ * Cache.cs: Re-introduce "InvokePrivateCallbacks" accidentally
+ removed in r80321.
+
2007-06-20 Marek Habersack <[EMAIL PROTECTED]>
* OutputCacheModule.cs: use Context.InternalCache.
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches