From 82c4ad3f3557ea844e1b5c776529f4155ae304c2 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Thu, 2 Dec 1999 23:46:00 +0000 Subject: [PATCH] Fix a webshell leak! improper nsCOMPtr useage in DestroyChildren was causing us to leak all child webshells!!! uhuh...that couldn't have been good git-svn-id: svn://10.0.0.236/trunk@55112 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 4 +++- mozilla/webshell/src/nsWebShell.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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(); }