diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 3ea77b7ff38..7ecee80d2b3 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -910,9 +910,7 @@ nsresult nsDocument::HandleDOMEvent(nsIPresContext& aPresContext, // We're leaving the DOM event loop so if we created a DOM event, release here. if (nsnull != *aDOMEvent) { nsrefcnt rc; - nsIDOMEvent* DOMEvent = *aDOMEvent; - // Release the copy since the macro will null the pointer - NS_RELEASE2(DOMEvent, rc); + NS_RELEASE2(*aDOMEvent, rc); if (0 != rc) { //Okay, so someone in the DOM loop (a listener, JS object) still has a ref to the DOM Event but //the internal data hasn't been malloc'd. Force a copy of the data here so the DOM Event is still valid. diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 14ee3b5c0b2..ea83c7e0d1a 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -735,9 +735,6 @@ nsGenericHTMLElement::~nsGenericHTMLElement() // Remove our reference to the shared content delegate object. If // the last reference just went away, null out gContentDelegate. nsrefcnt rc; - // XXX: This is now wrong. gContentDelegate will be null after the - // first call to NS_RELEASE2(...) - PR_ASSERT(0); NS_RELEASE2(gContentDelegate, rc); if (0 == rc) { gContentDelegate = nsnull; @@ -1137,9 +1134,7 @@ nsGenericHTMLElement::HandleDOMEvent(nsIPresContext& aPresContext, // release here. if (nsnull != *aDOMEvent) { nsrefcnt rc; - nsIDOMEvent* DOMEvent = *aDOMEvent; - // Release the copy since the macro will null the pointer - NS_RELEASE2(DOMEvent, rc); + NS_RELEASE2(*aDOMEvent, rc); if (0 != rc) { // Okay, so someone in the DOM loop (a listener, JS object) // still has a ref to the DOM Event but the internal data diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp index d192a51c31c..5374b4a12bd 100644 --- a/dom/src/base/nsGlobalWindow.cpp +++ b/dom/src/base/nsGlobalWindow.cpp @@ -1402,9 +1402,7 @@ GlobalWindowImpl::HandleDOMEvent(nsIPresContext& aPresContext, // We're leaving the DOM event loop so if we created a DOM event, release here. if (nsnull != *aDOMEvent) { nsrefcnt rc; - nsIDOMEvent* DOMEvent = *aDOMEvent; - // Release the copy since the macro will null the pointer - NS_RELEASE2(DOMEvent, rc); + NS_RELEASE2(*aDOMEvent, rc); if (0 != rc) { //Okay, so someone in the DOM loop (a listener, JS object) still has a ref to the DOM Event but //the internal data hasn't been malloc'd. Force a copy of the data here so the DOM Event is still valid. diff --git a/layout/base/src/nsDocument.cpp b/layout/base/src/nsDocument.cpp index 3ea77b7ff38..7ecee80d2b3 100644 --- a/layout/base/src/nsDocument.cpp +++ b/layout/base/src/nsDocument.cpp @@ -910,9 +910,7 @@ nsresult nsDocument::HandleDOMEvent(nsIPresContext& aPresContext, // We're leaving the DOM event loop so if we created a DOM event, release here. if (nsnull != *aDOMEvent) { nsrefcnt rc; - nsIDOMEvent* DOMEvent = *aDOMEvent; - // Release the copy since the macro will null the pointer - NS_RELEASE2(DOMEvent, rc); + NS_RELEASE2(*aDOMEvent, rc); if (0 != rc) { //Okay, so someone in the DOM loop (a listener, JS object) still has a ref to the DOM Event but //the internal data hasn't been malloc'd. Force a copy of the data here so the DOM Event is still valid. diff --git a/layout/html/base/src/nsHTMLContent.cpp b/layout/html/base/src/nsHTMLContent.cpp index c32aa5496dd..ad04a4ea42b 100644 --- a/layout/html/base/src/nsHTMLContent.cpp +++ b/layout/html/base/src/nsHTMLContent.cpp @@ -712,9 +712,7 @@ nsresult nsHTMLContent::HandleDOMEvent(nsIPresContext& aPresContext, // We're leaving the DOM event loop so if we created a DOM event, release here. if (nsnull != *aDOMEvent) { nsrefcnt rc; - nsIDOMEvent* DOMEvent = *aDOMEvent; - // Release the copy since the macro will null the pointer - NS_RELEASE2(DOMEvent, rc); + NS_RELEASE2(*aDOMEvent, rc); if (0 != rc) { //Okay, so someone in the DOM loop (a listener, JS object) still has a ref to the DOM Event but //the internal data hasn't been malloc'd. Force a copy of the data here so the DOM Event is still valid. diff --git a/layout/html/content/src/nsGenericHTMLElement.cpp b/layout/html/content/src/nsGenericHTMLElement.cpp index 14ee3b5c0b2..ea83c7e0d1a 100644 --- a/layout/html/content/src/nsGenericHTMLElement.cpp +++ b/layout/html/content/src/nsGenericHTMLElement.cpp @@ -735,9 +735,6 @@ nsGenericHTMLElement::~nsGenericHTMLElement() // Remove our reference to the shared content delegate object. If // the last reference just went away, null out gContentDelegate. nsrefcnt rc; - // XXX: This is now wrong. gContentDelegate will be null after the - // first call to NS_RELEASE2(...) - PR_ASSERT(0); NS_RELEASE2(gContentDelegate, rc); if (0 == rc) { gContentDelegate = nsnull; @@ -1137,9 +1134,7 @@ nsGenericHTMLElement::HandleDOMEvent(nsIPresContext& aPresContext, // release here. if (nsnull != *aDOMEvent) { nsrefcnt rc; - nsIDOMEvent* DOMEvent = *aDOMEvent; - // Release the copy since the macro will null the pointer - NS_RELEASE2(DOMEvent, rc); + NS_RELEASE2(*aDOMEvent, rc); if (0 != rc) { // Okay, so someone in the DOM loop (a listener, JS object) // still has a ref to the DOM Event but the internal data