Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Web / Hosting / SuspendManager.cs
index 392ff89edd6be748fcb9cfbdd6f636ef1930cc6b..a39a682a4878c6ec5cb057dbb57bcd419a306ec0 100644 (file)
@@ -78,9 +78,13 @@ namespace System.Web.Hosting {
                 HttpWriter.ReleaseAllPooledBuffers();
 
                 // Trim expired entries from the runtime cache
-                var cache = HttpRuntime.GetCacheInternal(createIfDoesNotExist: false);
-                if (cache != null) {
-                    cache.TrimCache(0);
+                var iCache = HttpRuntime.Cache.GetInternalCache(createIfDoesNotExist: false);
+                var oCache = HttpRuntime.Cache.GetObjectCache(createIfDoesNotExist: false);
+                if (iCache != null) {
+                    iCache.Trim(0);
+                }
+                if (oCache != null && !oCache.Equals(iCache)) {
+                    oCache.Trim(0);
                 }
 
                 // Trim all pooled HttpApplication instances