From 6f17f146e97bc6253194bf33d9ac58c4169795df Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 24 Aug 2005 21:08:53 +0000 Subject: [PATCH] Flush _before_ getting the presshell, not after. Bug 297079, r+sr=roc, a=asa git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@178855 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/xul/base/src/nsBoxObject.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mozilla/layout/xul/base/src/nsBoxObject.cpp b/mozilla/layout/xul/base/src/nsBoxObject.cpp index 9c8fc5795a5..c8c80ed3721 100644 --- a/mozilla/layout/xul/base/src/nsBoxObject.cpp +++ b/mozilla/layout/xul/base/src/nsBoxObject.cpp @@ -184,13 +184,14 @@ nsBoxObject::GetOffsetRect(nsRect& aRect) nsCOMPtr doc = mContent->GetDocument(); if (doc) { + // Flush all pending notifications so that our frames are uptodate. Must + // do this before we get the presshell, since this can destroy presshells. + doc->FlushPendingNotifications(Flush_Layout); + // Get Presentation shell 0 nsIPresShell *presShell = doc->GetShellAt(0); if(presShell) { - // Flush all pending notifications so that our frames are uptodate - doc->FlushPendingNotifications(Flush_Layout); - // Get the Frame for our content nsIFrame* frame = nsnull; presShell->GetPrimaryFrameFor(mContent, &frame);