From: Marek Habersack Date: Wed, 6 Jan 2010 10:46:45 +0000 (-0000) Subject: 2010-01-06 Marek Habersack X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=0bf9d459361b8fbcb118c5b18286e24b4ff3472e;p=mono.git 2010-01-06 Marek Habersack * 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 --- diff --git a/mcs/class/System.Web/System.Web.Caching/CacheItemPriorityQueue.cs b/mcs/class/System.Web/System.Web.Caching/CacheItemPriorityQueue.cs index 179c5648bcc..99e4e731382 100644 --- a/mcs/class/System.Web/System.Web.Caching/CacheItemPriorityQueue.cs +++ b/mcs/class/System.Web/System.Web.Caching/CacheItemPriorityQueue.cs @@ -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; diff --git a/mcs/class/System.Web/System.Web.Caching/ChangeLog b/mcs/class/System.Web/System.Web.Caching/ChangeLog index ba8026edd0c..fbc14e44453 100644 --- a/mcs/class/System.Web/System.Web.Caching/ChangeLog +++ b/mcs/class/System.Web/System.Web.Caching/ChangeLog @@ -1,3 +1,8 @@ +2010-01-06 Marek Habersack + + * 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 * Cache.cs: ExpireItems dequeues the next item when a disabled