Fixed up usage of the NS_RELEASE2(...) macro.

git-svn-id: svn://10.0.0.236/trunk@10247 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rpotts%netscape.com
1998-09-17 05:40:57 +00:00
parent 1ce4b0ca1a
commit 435c373c8d
6 changed files with 6 additions and 24 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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