зеркало из https://github.com/mozilla/pjs.git
Fixed up usage of the NS_RELEASE2(...) macro.
This commit is contained in:
Родитель
dac2d400b3
Коммит
7909491271
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче