GtkMountOperation: Clean up a dangling signal handler
Based on a patch by Eugene Shatokhin, https://bugzilla.gnome.org/show_bug.cgi?id=723366
This commit is contained in:
@ -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");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user