From 3561d0632c5fbae85a93b43fdbe420aee38a36ae Mon Sep 17 00:00:00 2001 From: "mrbkap%gmail.com" Date: Wed, 1 Jun 2005 22:37:04 +0000 Subject: [PATCH] bug 296121: The parser leaks when somebody calls document.open() and doesn't write any data. r+sr=bzbarsky a=shaver git-svn-id: svn://10.0.0.236/trunk@173997 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/parser/htmlparser/src/nsParser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mozilla/parser/htmlparser/src/nsParser.cpp b/mozilla/parser/htmlparser/src/nsParser.cpp index 9f78c91004b..4c5fcda3c35 100644 --- a/mozilla/parser/htmlparser/src/nsParser.cpp +++ b/mozilla/parser/htmlparser/src/nsParser.cpp @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set sw=2 ts=2 et tw=78: */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -1413,7 +1414,8 @@ NS_IMETHODIMP nsParser::Terminate(void) else if (mSink) { // We have no parser context or no DTD yet (so we got terminated before we // got any data). Manually break the reference cycle with the sink. - mSink->SetParser(nsnull); + result = mSink->DidBuildModel(); + NS_ENSURE_SUCCESS(result, result); } return NS_OK; }