Ignore restyle requests once PresShell::Destroy() has been called. b=279505 r+sr=bzbarsky a=mtschrep
authormats.palmgren@bredband.net
Fri, 18 Jan 2008 10:18:19 -0800
changeset 10402 be9ec7c85bb6eb9a01ad47b4272a4e5fad4a04cc
parent 10401 019aed1117cf1db923ec93fa49061a0873eeb2dd
child 10403 bb20d5a24a3a37283c5e4c7195339fea0d85141a
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtschrep
bugs279505
milestone1.9b3pre
Ignore restyle requests once PresShell::Destroy() has been called. b=279505 r+sr=bzbarsky a=mtschrep
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -13268,16 +13268,21 @@ nsCSSFrameConstructor::ProcessPendingRes
   }
 }
 
 void
 nsCSSFrameConstructor::PostRestyleEvent(nsIContent* aContent,
                                         nsReStyleHint aRestyleHint,
                                         nsChangeHint aMinChangeHint)
 {
+  if (NS_UNLIKELY(mIsDestroyingFrameTree)) {
+    NS_NOTREACHED("PostRestyleEvent after the shell is destroyed (bug 279505)");
+    return;
+  }
+
   if (aRestyleHint == 0 && !aMinChangeHint) {
     // Nothing to do here
     return;
   }
 
   NS_ASSERTION(aContent->IsNodeOfType(nsINode::eELEMENT),
                "Shouldn't be trying to restyle non-elements directly");