[gnome-applets] windowpicker/task-title.c: Disconnect signal handlers in dispose function
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] windowpicker/task-title.c: Disconnect signal handlers in dispose function
- Date: Tue, 9 Jun 2015 11:05:27 +0000 (UTC)
commit 1eb65a2240aecfcc4303ffaf6ac0ce8d3209c29a
Author: Sebastian Geiger <sbastig gmx net>
Date: Sun Jun 7 14:45:01 2015 +0200
windowpicker/task-title.c: Disconnect signal handlers in dispose function
When the object is destroyed the signal handlers
need to be disconnected to avoid that they
are called after the object has already been destroyed.
This only affects signal handlers that are not related to the object itself,
such as for WnckScreen.
windowpicker/src/task-title.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/windowpicker/src/task-title.c b/windowpicker/src/task-title.c
index 242fc01..db9e003 100644
--- a/windowpicker/src/task-title.c
+++ b/windowpicker/src/task-title.c
@@ -185,6 +185,7 @@ static void hide_title(TaskTitle *title) {
gtk_widget_set_tooltip_text (GTK_WIDGET (title), NULL);
gtk_widget_hide (title->priv->grid);
}
+
static void
on_active_window_changed (WnckScreen *screen,
WnckWindow *old_window,
@@ -405,14 +406,15 @@ task_title_setup (TaskTitle *title)
}
static void
-task_title_finalize (GObject *object)
+task_title_dispose (GObject *object)
{
TaskTitle *title = TASK_TITLE (object);
+ g_signal_handlers_disconnect_by_func (title->priv->screen, on_active_window_changed, title);
disconnect_window (title);
- g_object_unref (title->priv->quit_icon);
- G_OBJECT_CLASS (task_title_parent_class)->finalize (object);
+ g_clear_object (&title->priv->quit_icon);
+ G_OBJECT_CLASS (task_title_parent_class)->dispose (object);
}
static GObject *
@@ -443,7 +445,7 @@ task_title_class_init (TaskTitleClass *klass)
GObjectClass *obj_class = G_OBJECT_CLASS (klass);
obj_class->constructor = task_title_constructor;
- obj_class->finalize = task_title_finalize;
+ obj_class->dispose = task_title_dispose;
}
GtkWidget *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]