diff --git a/mozilla/content/events/src/nsDOMEvent.cpp b/mozilla/content/events/src/nsDOMEvent.cpp index b4bc84126f6..71bc563f1a2 100644 --- a/mozilla/content/events/src/nsDOMEvent.cpp +++ b/mozilla/content/events/src/nsDOMEvent.cpp @@ -225,7 +225,7 @@ NS_METHOD nsDOMEvent::GetScreenX(PRInt32* aScreenX) nsIWidget* parent = ((nsGUIEvent*)mEvent)->widget; //Add extra since loop will free one. - NS_ADDREF(parent); + NS_IF_ADDREF(parent); nsIWidget* tmp; while (nsnull != parent) { parent->GetBounds(bounds); @@ -246,7 +246,7 @@ NS_METHOD nsDOMEvent::GetScreenY(PRInt32* aScreenY) nsIWidget* parent = ((nsGUIEvent*)mEvent)->widget; //Add extra since loop will free one. - NS_ADDREF(parent); + NS_IF_ADDREF(parent); nsIWidget* tmp; while (nsnull != parent) { parent->GetBounds(bounds); diff --git a/mozilla/layout/events/src/nsDOMEvent.cpp b/mozilla/layout/events/src/nsDOMEvent.cpp index b4bc84126f6..71bc563f1a2 100644 --- a/mozilla/layout/events/src/nsDOMEvent.cpp +++ b/mozilla/layout/events/src/nsDOMEvent.cpp @@ -225,7 +225,7 @@ NS_METHOD nsDOMEvent::GetScreenX(PRInt32* aScreenX) nsIWidget* parent = ((nsGUIEvent*)mEvent)->widget; //Add extra since loop will free one. - NS_ADDREF(parent); + NS_IF_ADDREF(parent); nsIWidget* tmp; while (nsnull != parent) { parent->GetBounds(bounds); @@ -246,7 +246,7 @@ NS_METHOD nsDOMEvent::GetScreenY(PRInt32* aScreenY) nsIWidget* parent = ((nsGUIEvent*)mEvent)->widget; //Add extra since loop will free one. - NS_ADDREF(parent); + NS_IF_ADDREF(parent); nsIWidget* tmp; while (nsnull != parent) { parent->GetBounds(bounds);