From dba04650ad89a13233d314fa12c9aa3b3d080b45 Mon Sep 17 00:00:00 2001 From: "mjudge%netscape.com" Date: Tue, 1 Dec 1998 20:58:53 +0000 Subject: [PATCH] fixing mac build bustages git-svn-id: svn://10.0.0.236/trunk@15550 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/xpwidgets/nsBaseWidget.cpp | 2 ++ mozilla/widget/tests/scribble/Scribble.cpp | 3 ++- mozilla/widget/tests/widget/mac/nsWidgetTest.cpp | 2 -- mozilla/widget/tests/widget/nsWidgetTest.cpp | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp b/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp index 76527a3d98d..322616eb0f4 100644 --- a/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp +++ b/mozilla/widget/src/xpwidgets/nsBaseWidget.cpp @@ -238,7 +238,9 @@ nsIEnumerator* nsBaseWidget::GetChildren() } if (NS_OK == child->QueryInterface(kIWidgetIID, (void**)&widget)) { children->Append(widget); + NS_IF_RELEASE(widget); } + NS_IF_RELEASE(child); } while (NS_SUCCEEDED(mChildren->Next())); diff --git a/mozilla/widget/tests/scribble/Scribble.cpp b/mozilla/widget/tests/scribble/Scribble.cpp index bdca229a987..08ab8766b42 100644 --- a/mozilla/widget/tests/scribble/Scribble.cpp +++ b/mozilla/widget/tests/scribble/Scribble.cpp @@ -112,8 +112,9 @@ nsEventStatus PR_CALLBACK HandleEventMain(nsGUIEvent *aEvent) if (NS_OK == child->QueryInterface(kIWidgetIID, (void**)&widget)) { widget->Resize(0, 0, 200, ((nsSizeEvent*)aEvent)->windowSize->height, PR_TRUE); - NS_RELEASE(widget); + NS_IF_RELEASE(widget); } + NS_IF_RELEASE(child); } NS_RELEASE(enumer); diff --git a/mozilla/widget/tests/widget/mac/nsWidgetTest.cpp b/mozilla/widget/tests/widget/mac/nsWidgetTest.cpp index 864444e9c06..07231fd0d46 100644 --- a/mozilla/widget/tests/widget/mac/nsWidgetTest.cpp +++ b/mozilla/widget/tests/widget/mac/nsWidgetTest.cpp @@ -888,7 +888,6 @@ void DumpRects() // print all children's position nsIEnumerator *enumerator = window->GetChildren(); nsISupports * widget; - nsISupports * widget; do { if (!NS_SUCCEEDED(enumerator->CurrentItem(&widget))) { return; @@ -900,7 +899,6 @@ void DumpRects() printf("Bounds(%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height); NS_RELEASE(child); } - NS_RELEASE(child); NS_RELEASE(widget); } while (NS_SUCCEEDED(enumerator->Next())); diff --git a/mozilla/widget/tests/widget/nsWidgetTest.cpp b/mozilla/widget/tests/widget/nsWidgetTest.cpp index 32a3452cc56..8fbc624473b 100644 --- a/mozilla/widget/tests/widget/nsWidgetTest.cpp +++ b/mozilla/widget/tests/widget/nsWidgetTest.cpp @@ -843,7 +843,6 @@ void DumpRects() printf("Bounds(%d, %d, %d, %d)\n", rect.x, rect.y, rect.width, rect.height); NS_RELEASE(child); } - NS_RELEASE(child); NS_RELEASE(widget); } while (NS_SUCCEEDED(enumerator->Next()));