[gtk+] Plug a mem leak
- From: Matthias Clasen <matthiasc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Plug a mem leak
- Date: Sun, 30 Aug 2009 01:21:24 +0000 (UTC)
commit 2105d946cf76a342aa63c34f3030911dc3d7ea17
Author: Christian Persch <chpe gnome org>
Date: Sat Aug 29 21:15:10 2009 -0400
Plug a mem leak
GtkWindow was leaking the startup_id, reported in bug 593317.
gtk/gtkwindow.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index de43dae..b95d042 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4400,6 +4400,7 @@ static void
gtk_window_finalize (GObject *object)
{
GtkWindow *window = GTK_WINDOW (object);
+ GtkWindowPrivate *priv = GTK_WINDOW_GET_PRIVATE (window);
GtkMnemonicHash *mnemonic_hash;
g_free (window->title);
@@ -4427,11 +4428,11 @@ gtk_window_finalize (GObject *object)
}
if (window->screen)
- {
- g_signal_handlers_disconnect_by_func (window->screen,
- gtk_window_on_composited_changed, window);
- }
-
+ g_signal_handlers_disconnect_by_func (window->screen,
+ gtk_window_on_composited_changed, window);
+
+ g_free (priv->startup_id);
+
G_OBJECT_CLASS (gtk_window_parent_class)->finalize (object);
}
@@ -4601,7 +4602,8 @@ gtk_window_map (GtkWidget *widget)
/* Make sure we have a "real" id */
if (!startup_id_is_fake (priv->startup_id))
gdk_notify_startup_complete_with_id (priv->startup_id);
-
+
+ g_free (priv->startup_id);
priv->startup_id = NULL;
}
else if (!sent_startup_notification)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]