Bug 967364: Pass already_AddRefed by reference instead of by value. r=bsmedberg

This commit is contained in:
Kyle Huey
2014-03-15 12:00:17 -07:00
parent 77f0f51293
commit 18bbe187f5
299 changed files with 760 additions and 628 deletions

View File

@@ -126,7 +126,8 @@ nsresult nsDocShellForwardsEnumerator::BuildArrayRecursive(nsIDocShellTreeItem*
// add this item to the array
if (mDocShellType == nsIDocShellTreeItem::typeAll ||
inItem->ItemType() == mDocShellType) {
if (!inItemArray.AppendElement(do_GetWeakReference(inItem)))
nsWeakPtr weakItem = do_GetWeakReference(inItem);
if (!inItemArray.AppendElement(weakItem))
return NS_ERROR_OUT_OF_MEMORY;
}
@@ -169,7 +170,8 @@ nsresult nsDocShellBackwardsEnumerator::BuildArrayRecursive(nsIDocShellTreeItem*
// add this item to the array
if (mDocShellType == nsIDocShellTreeItem::typeAll ||
inItem->ItemType() == mDocShellType) {
if (!inItemArray.AppendElement(do_GetWeakReference(inItem)))
nsWeakPtr weakItem = do_GetWeakReference(inItem);
if (!inItemArray.AppendElement(weakItem))
return NS_ERROR_OUT_OF_MEMORY;
}