Bug 849597 - Add more kung fu to nsParser. r=smaug.

This commit is contained in:
Henri Sivonen 2013-04-05 15:36:16 +03:00
parent 211c0ab4e0
commit b36ba54ca7

View File

@ -1099,6 +1099,7 @@ nsParser::ContinueInterruptedParsing()
// the reenabling process, hold a reference to ourselves.
nsresult result=NS_OK;
nsCOMPtr<nsIParser> kungFuDeathGrip(this);
nsCOMPtr<nsIContentSink> sinkDeathGrip(mSink);
#ifdef DEBUG
if (!(mFlags & NS_PARSER_FLAG_PARSER_ENABLED)) {
@ -1909,6 +1910,8 @@ nsParser::OnDataAvailable(nsIRequest *request, nsISupports* aContext,
// non-whitespace data
if (IsOkToProcessNetworkData() &&
theContext->mScanner->FirstNonWhitespacePosition() >= 0) {
nsCOMPtr<nsIParser> kungFuDeathGrip(this);
nsCOMPtr<nsIContentSink> sinkDeathGrip(mSink);
mProcessingNetworkData = true;
if (mSink) {
mSink->WillParse();