Bug 1350049: Handle nsParser being finalized before resuming. r=hsivonen

This is a hybrid of the previous two approaches. The nsParser weak reference
sometimes stays alive after it's been detached from the document, after which
attempting to remove it throws. This stores a reference to the original
parser, and checks that it's still the current parser when it comes time to
resume.

MozReview-Commit-ID: 1JSi2FmPxt0
This commit is contained in:
Kris Maglione
2017-03-28 15:24:26 -07:00
parent e7ae6e7169
commit 2ffe4aca2e
2 changed files with 15 additions and 5 deletions

View File

@@ -682,7 +682,10 @@ nsParser::UnblockParser()
NS_IMETHODIMP_(void)
nsParser::ContinueInterruptedParsingAsync()
{
mSink->ContinueInterruptedParsingAsync();
MOZ_ASSERT(mSink);
if (MOZ_LIKELY(mSink)) {
mSink->ContinueInterruptedParsingAsync();
}
}
/**