Make sure to addref documents before calling Init(). Bug 291887, r+sr=jst,

a=brendan


git-svn-id: svn://10.0.0.236/trunk@172815 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2005-04-28 17:16:19 +00:00
parent c492a14c63
commit da850874f2
4 changed files with 15 additions and 23 deletions

View File

@@ -193,18 +193,16 @@ NS_NewHTMLDocument(nsIDocument** aInstancePtrResult)
nsHTMLDocument* doc = new nsHTMLDocument();
NS_ENSURE_TRUE(doc, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(doc);
nsresult rv = doc->Init();
if (NS_FAILED(rv)) {
delete doc;
return rv;
NS_RELEASE(doc);
}
*aInstancePtrResult = doc;
NS_ADDREF(*aInstancePtrResult);
return NS_OK;
return rv;
}
class IdAndNameMapEntry : public PLDHashEntryHdr