From 6f13208339fd38fc25c06c65d830f8781599fcdb Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Tue, 11 Jul 2000 22:17:38 +0000 Subject: [PATCH] setting parent to null to make sure there are no dnagling pointers from children to their parents b=44266, r=jst --- content/html/content/src/nsGenericHTMLElement.cpp | 1 + layout/html/content/src/nsGenericHTMLElement.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index de091eeff7fe..582756cee3e0 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -3233,6 +3233,7 @@ nsGenericHTMLContainerElement::~nsGenericHTMLContainerElement() PRInt32 n = mChildren.Count(); for (PRInt32 i = 0; i < n; i++) { nsIContent* kid = (nsIContent *)mChildren.ElementAt(i); + kid->SetParent(nsnull); NS_RELEASE(kid); } } diff --git a/layout/html/content/src/nsGenericHTMLElement.cpp b/layout/html/content/src/nsGenericHTMLElement.cpp index de091eeff7fe..582756cee3e0 100644 --- a/layout/html/content/src/nsGenericHTMLElement.cpp +++ b/layout/html/content/src/nsGenericHTMLElement.cpp @@ -3233,6 +3233,7 @@ nsGenericHTMLContainerElement::~nsGenericHTMLContainerElement() PRInt32 n = mChildren.Count(); for (PRInt32 i = 0; i < n; i++) { nsIContent* kid = (nsIContent *)mChildren.ElementAt(i); + kid->SetParent(nsnull); NS_RELEASE(kid); } }