From 3a3369076f604f499f4b8ed2faeae74dec562816 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Tue, 5 Oct 1999 23:57:57 +0000 Subject: [PATCH] Fixed a memory leak of widgets triggered when the close box for a window is hit git-svn-id: svn://10.0.0.236/trunk@49903 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/gtk/nsWindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mozilla/widget/src/gtk/nsWindow.cpp b/mozilla/widget/src/gtk/nsWindow.cpp index 4913daf94e2..2f5b72eaca7 100644 --- a/mozilla/widget/src/gtk/nsWindow.cpp +++ b/mozilla/widget/src/gtk/nsWindow.cpp @@ -136,8 +136,9 @@ NS_IMETHODIMP nsWindow::Destroy() if (mIsDestroyingWindow == PR_TRUE) { nsBaseWidget::Destroy(); - if (PR_FALSE == mOnDestroyCalled) + if (PR_FALSE == mOnDestroyCalled) { nsWidget::OnDestroy(); + } if (mShell) { if (GTK_IS_WIDGET(mShell)) @@ -160,8 +161,10 @@ nsWindow::OnDestroySignal(GtkWidget* aGtkWidget) gint handle_delete_event(GtkWidget *w, GdkEventAny *e, nsWindow *win) { + NS_ADDREF(win); win->SetIsDestroying( PR_TRUE ); win->Destroy(); + NS_RELEASE(win); return TRUE; }