Bug 757203 - crash in nsXULTreeAccessible::InvalidateCache when deleting cookie, r=surkov
authorMark Capella <markcapella@twcny.rr.com>
Fri, 15 Jun 2012 04:03:57 -0400
changeset 96812 8aa06f0cc71423147d4926b1c6ed30f0842188f1
parent 96811 21ab04d13974ba40333172e2af56def2c2aa0e3f
child 96813 eb67e4c9f7dfaa557d4c33cbf1abd310cfb64322
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssurkov
bugs757203
milestone16.0a1
Bug 757203 - crash in nsXULTreeAccessible::InvalidateCache when deleting cookie, r=surkov
accessible/src/xul/XULTreeAccessible.cpp
--- a/accessible/src/xul/XULTreeAccessible.cpp
+++ b/accessible/src/xul/XULTreeAccessible.cpp
@@ -548,16 +548,21 @@ XULTreeAccessible::GetTreeItemAccessible
 }
 
 void
 XULTreeAccessible::InvalidateCache(PRInt32 aRow, PRInt32 aCount)
 {
   if (IsDefunct())
     return;
 
+  if (!mTreeView) {
+    ClearCache(mAccessibleCache);
+    return;
+  }
+
   // Do not invalidate the cache if rows have been inserted.
   if (aCount > 0)
     return;
 
   DocAccessible* document = Document();
 
   // Fire destroy event for removed tree items and delete them from caches.
   for (PRInt32 rowIdx = aRow; rowIdx < aRow - aCount; rowIdx++) {