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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user