[gnome-applets/wip/segeiger/window-picker-in-process] windowpicker/task-item.c: Properly disconnect signal handlers in dispose function
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/wip/segeiger/window-picker-in-process] windowpicker/task-item.c: Properly disconnect signal handlers in dispose function
- Date: Sun, 7 Jun 2015 18:36:06 +0000 (UTC)
commit fe27d1e391258ebacab70e321f31ebe2f9c72b98
Author: Sebastian Geiger <sbastig gmx net>
Date: Sun Jun 7 20:33:33 2015 +0200
windowpicker/task-item.c: Properly disconnect signal handlers in dispose function
windowpicker/src/task-item.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/windowpicker/src/task-item.c b/windowpicker/src/task-item.c
index 4fddc4d..feb9eee 100644
--- a/windowpicker/src/task-item.c
+++ b/windowpicker/src/task-item.c
@@ -755,6 +755,35 @@ static void task_item_setup_atk (TaskItem *item) {
atk_object_set_role (atk, ATK_ROLE_PUSH_BUTTON);
}
+static void task_item_dispose (GObject *object) {
+ TaskItem *task_item = TASK_ITEM (object);
+
+ g_signal_handlers_disconnect_by_func(task_item, on_drag_motion, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_drag_leave, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_drag_received_data, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_drag_end, NULL);
+ g_signal_handlers_disconnect_by_func(task_item, on_drag_failed, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_drag_begin, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_drag_get_data, task_item);
+
+ g_signal_handlers_disconnect_by_func(task_item, on_screen_active_viewport_changed, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_screen_active_window_changed, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_screen_active_workspace_changed, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_screen_window_closed, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_window_workspace_changed, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_window_state_changed, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_window_icon_changed, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, task_item_draw, task_item->priv->windowPickerApplet);
+ g_signal_handlers_disconnect_by_func(task_item, on_task_item_button_released, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_button_pressed, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_size_allocate, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_query_tooltip, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_enter_notify, task_item);
+ g_signal_handlers_disconnect_by_func(task_item, on_leave_notify, task_item);
+
+ G_OBJECT_CLASS (task_item_parent_class)->dispose (object);
+}
+
static void task_item_finalize (GObject *object) {
TaskItemPrivate *priv = TASK_ITEM (object)->priv;
/* remove timer */
@@ -771,6 +800,7 @@ static void task_item_finalize (GObject *object) {
static void task_item_class_init (TaskItemClass *klass) {
GObjectClass *obj_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ obj_class->dispose = task_item_dispose;
obj_class->finalize = task_item_finalize;
widget_class->get_preferred_width = task_item_get_preferred_width;
widget_class->get_preferred_height = task_item_get_preferred_height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]