Bug 1440523 - Bail out from nsHTMLDocument::EditingStateChanged if the docshell is being destroyed by FlushPendingNotifications call. r=masayuki
MozReview-Commit-ID: DlFXWdpB1Xv
This commit is contained in:
@@ -2363,6 +2363,13 @@ nsHTMLDocument::EditingStateChanged()
|
||||
if (!docshell)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// FlushPendingNotifications might destroy our docshell.
|
||||
bool isBeingDestroyed = false;
|
||||
docshell->IsBeingDestroyed(&isBeingDestroyed);
|
||||
if (isBeingDestroyed) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIEditingSession> editSession;
|
||||
nsresult rv = docshell->GetEditingSession(getter_AddRefs(editSession));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
Reference in New Issue
Block a user