Bug 577963 - Flushing notifications can cause mPresShell to be destroyed. r=masayuki,smaug a=blocking2.0

This commit is contained in:
Steven Michaud 2010-08-05 09:42:02 -05:00
parent 39b2609bc8
commit ea45199f0e
2 changed files with 4 additions and 4 deletions

View File

@ -88,11 +88,11 @@ nsContentEventHandler::InitCommon()
// we need to flush the pending reflow here.
mPresShell->FlushPendingNotifications(Flush_Layout);
// Flushing notifications can cause mPresShell to be destroyed (bug 577963).
NS_ENSURE_TRUE(!mPresShell->IsDestroying(), NS_ERROR_FAILURE);
nsCopySupport::GetSelectionForCopy(mPresShell->GetDocument(),
getter_AddRefs(mSelection));
NS_ASSERTION(mSelection,
"GetSelectionForCopy succeeded, but the result is null");
nsCOMPtr<nsIDOMRange> firstRange;
nsresult rv = mSelection->GetRangeAt(0, getter_AddRefs(firstRange));

View File

@ -89,7 +89,7 @@ public:
protected:
nsPresContext* mPresContext;
nsIPresShell* mPresShell;
nsCOMPtr<nsIPresShell> mPresShell;
nsCOMPtr<nsISelection> mSelection;
nsCOMPtr<nsIRange> mFirstSelectedRange;
nsCOMPtr<nsIContent> mRootContent;