[gtk+] GtkMountOperation: Clean up a dangling signal handler
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkMountOperation: Clean up a dangling signal handler
- Date: Tue, 4 Feb 2014 02:01:18 +0000 (UTC)
commit 05f2f634260519b5448ffd53e8883412c0251443
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Feb 3 21:00:17 2014 -0500
GtkMountOperation: Clean up a dangling signal handler
Based on a patch by Eugene Shatokhin,
https://bugzilla.gnome.org/show_bug.cgi?id=723366
gtk/gtkmountoperation.c | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 6016a1b..0ac9c2a 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -212,7 +212,12 @@ gtk_mount_operation_finalize (GObject *object)
g_list_free (priv->user_widgets);
if (priv->parent_window)
- g_object_unref (priv->parent_window);
+ {
+ g_signal_handlers_disconnect_by_func (priv->parent_window,
+ gtk_widget_destroyed,
+ &priv->parent_window);
+ g_object_unref (priv->parent_window);
+ }
if (priv->screen)
g_object_unref (priv->screen);
@@ -1736,21 +1741,20 @@ gtk_mount_operation_set_parent (GtkMountOperation *op,
g_signal_handlers_disconnect_by_func (priv->parent_window,
gtk_widget_destroyed,
&priv->parent_window);
- priv->parent_window = NULL;
+ g_object_unref (priv->parent_window);
}
-
- if (parent)
+ priv->parent_window = parent;
+ if (priv->parent_window)
{
- priv->parent_window = g_object_ref (parent);
-
- g_signal_connect (parent, "destroy",
+ g_object_ref (priv->parent_window);
+ g_signal_connect (priv->parent_window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&priv->parent_window);
-
- if (priv->dialog)
- gtk_window_set_transient_for (GTK_WINDOW (priv->dialog), parent);
}
+ if (priv->dialog)
+ gtk_window_set_transient_for (GTK_WINDOW (priv->dialog), priv->parent_window);
+
g_object_notify (G_OBJECT (op), "parent");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]