Bug 729519 - Use SafelyDestroyFrameListProp also for the OverflowList. r=bzbarsky
authorMats Palmgren <matspal@gmail.com>
Mon, 01 Apr 2013 17:26:02 +0200
changeset 133280 37bebc3a719ed27626b155aa96d5a03abba9539b
parent 133279 17b3ba7a38f216515f5dac9e6d381d445f1ae578
child 133281 ba8a10a35c183a8760a848d0129da3289ac32d44
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky
bugs729519
milestone22.0a1
Bug 729519 - Use SafelyDestroyFrameListProp also for the OverflowList. r=bzbarsky
layout/generic/nsContainerFrame.cpp
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -234,40 +234,37 @@ nsContainerFrame::SafelyDestroyFrameList
       return;
     }
   }
 }
 
 void
 nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot)
 {
-  // Prevent event dispatch during destruction
+  // Prevent event dispatch during destruction.
   if (HasView()) {
     GetView()->SetFrame(nullptr);
   }
 
   DestroyAbsoluteFrames(aDestructRoot);
 
-  // Delete the primary child list
+  // Destroy frames on the principal child list.
   mFrames.DestroyFramesFrom(aDestructRoot);
 
-  // Destroy auxiliary frame lists
-  nsPresContext* prescontext = PresContext();
-
-  DestroyOverflowList(prescontext, aDestructRoot);
+  // Destroy frames on the auxiliary frame lists and delete the lists.
+  FramePropertyTable* props = PresContext()->PropertyTable();
+  SafelyDestroyFrameListProp(aDestructRoot, props, OverflowProperty());
 
   if (IsFrameOfType(nsIFrame::eCanContainOverflowContainers)) {
-    FramePropertyTable* props = prescontext->PropertyTable();
     SafelyDestroyFrameListProp(aDestructRoot, props,
                                OverflowContainersProperty());
     SafelyDestroyFrameListProp(aDestructRoot, props,
                                ExcessOverflowContainersProperty());
   }
 
-  // Destroy the frame and remove the flow pointers
   nsSplittableFrame::DestroyFrom(aDestructRoot);
 }
 
 /////////////////////////////////////////////////////////////////////////////
 // Child frame enumeration
 
 const nsFrameList&
 nsContainerFrame::GetChildList(ChildListID aListID) const