diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 931ef8bc069..aded601146f 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -744,10 +744,12 @@ nsWebShell::DestroyChildren() { PRInt32 i, n = mChildren.Count(); for (i = 0; i < n; i++) { - nsCOMPtr shell = (nsIDocShell*) mChildren.ElementAt(i); + nsIDocShell * shell = (nsIDocShell*) mChildren.ElementAt(i); shell->SetParent(nsnull); nsCOMPtr shellWin(do_QueryInterface(shell)); shellWin->Destroy(); + NS_RELEASE(shell); + } mChildren.Clear(); } diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index 931ef8bc069..aded601146f 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -744,10 +744,12 @@ nsWebShell::DestroyChildren() { PRInt32 i, n = mChildren.Count(); for (i = 0; i < n; i++) { - nsCOMPtr shell = (nsIDocShell*) mChildren.ElementAt(i); + nsIDocShell * shell = (nsIDocShell*) mChildren.ElementAt(i); shell->SetParent(nsnull); nsCOMPtr shellWin(do_QueryInterface(shell)); shellWin->Destroy(); + NS_RELEASE(shell); + } mChildren.Clear(); }