Bug 494283. Clean up placeholders better. r=dbaron, a=samuelsidler
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 06 Aug 2009 17:30:18 -0400
changeset 26196 b3755cc5e6f08cb6d122f63110b59a60ed651a68
parent 26195 8c48ddda2d4f4fbeaa762b43916baf5efd26d46c
child 26197 0e95a94297933d2d43a887dc0a919fe2e5e7199e
push id1850
push userbzbarsky@mozilla.com
push dateThu, 06 Aug 2009 21:36:55 +0000
reviewersdbaron, samuelsidler
bugs494283
milestone1.9.1.3pre
Bug 494283. Clean up placeholders better. r=dbaron, a=samuelsidler
layout/generic/nsPlaceholderFrame.cpp
--- a/layout/generic/nsPlaceholderFrame.cpp
+++ b/layout/generic/nsPlaceholderFrame.cpp
@@ -122,19 +122,23 @@ nsPlaceholderFrame::Reflow(nsPresContext
   return NS_OK;
 }
 
 void
 nsPlaceholderFrame::Destroy()
 {
   nsIPresShell* shell = PresContext()->GetPresShell();
   if (shell && mOutOfFlowFrame) {
-    NS_ASSERTION(!shell->FrameManager()->GetPlaceholderFrameFor(mOutOfFlowFrame),
-                 "Placeholder relationship should have been torn down; see "
-                 "comments in nsPlaceholderFrame.h");
+    if (shell->FrameManager()->GetPlaceholderFrameFor(mOutOfFlowFrame)) {
+      NS_ERROR("Placeholder relationship should have been torn down; see "
+               "comments in nsPlaceholderFrame.h.  Unregistering ourselves, "
+               "but this might cause our out-of-flow to be unable to destroy "
+               "itself properly.  Not that it could anyway, with us dead.");
+      shell->FrameManager()->UnregisterPlaceholderFrame(this);
+    }
   }
 
   nsSplittableFrame::Destroy();
 }
 
 nsSplittableType
 nsPlaceholderFrame::GetSplittableType() const
 {