2010-01-06 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Wed, 6 Jan 2010 10:46:45 +0000 (10:46 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 6 Jan 2010 10:46:45 +0000 (10:46 -0000)
* CacheItemPriorityQueue.cs: make sure lastParent is never null if
root is not null in Enqueue. Possible fix for bug #567869

svn path=/trunk/mcs/; revision=149118

mcs/class/System.Web/System.Web.Caching/CacheItemPriorityQueue.cs
mcs/class/System.Web/System.Web.Caching/ChangeLog

index 179c5648bcca5790c4073921fe06f864d76cead7..99e4e73138253143b85ec59fa8661c942bb6ae60 100644 (file)
@@ -96,10 +96,15 @@ namespace System.Web.Caching
                                        if (lastParent == null) {
                                                lastParent = firstParent = firstParent.Left;
                                                lastAdded = null;
+
+                                               if (lastParent == null) {
+                                                       lastParent = root;
+                                                       firstParent = root;
+                                               }
                                        }
                                }
 
-                               node.Parent = lastParent;                       
+                               node.Parent = lastParent;       
                                if (lastParent.Left == null)
                                        lastParent.Left = node;
                                else
@@ -135,7 +140,7 @@ namespace System.Web.Caching
                        
                                if (root.Left == null && root.Right == null) {
                                        ret = root.Data;
-                                       root = null;
+                                       root = lastAdded = firstParent = lastParent = null;
                                        if (ret.Disabled)
                                                return null;
                                
index ba8026edd0c44c7fec4de39d1f2d347a5d478983..fbc14e44453af0a9cb0c104bbb2a63665bc60373 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-06  Marek Habersack  <mhabersack@novell.com>
+
+       * CacheItemPriorityQueue.cs: make sure lastParent is never null if
+       root is not null in Enqueue. Possible fix for bug #567869
+
 2009-12-01  Marek Habersack  <mhabersack@novell.com>
 
        * Cache.cs: ExpireItems dequeues the next item when a disabled