From b1f7d011419a9d621ccd8d3c28f4ed2837876279 Mon Sep 17 00:00:00 2001 From: monsta Date: Tue, 17 Oct 2017 16:31:26 +0300 Subject: window picker: disconnect signal handlers in dispose function taken from: https://git.gnome.org/browse/gnome-applets/commit/?id=3736cbfc9483fa36a8f7d620d1e75ad2973bcc08 --- mate-window-picker-applet/task-item.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mate-window-picker-applet/task-item.c b/mate-window-picker-applet/task-item.c index 1eca186..a3a1089 100644 --- a/mate-window-picker-applet/task-item.c +++ b/mate-window-picker-applet/task-item.c @@ -686,6 +686,22 @@ task_item_setup_atk (TaskItem *item) atk_object_set_role (atk, ATK_ROLE_PUSH_BUTTON); } +static void +task_item_dispose (GObject *object) +{ + TaskItem *item = TASK_ITEM (object); + + g_signal_handlers_disconnect_by_func (item->priv->screen, G_CALLBACK (on_screen_active_viewport_changed), item); + g_signal_handlers_disconnect_by_func (item->priv->screen, G_CALLBACK (on_screen_active_window_changed), item); + g_signal_handlers_disconnect_by_func (item->priv->screen, G_CALLBACK (on_screen_active_workspace_changed), item); + g_signal_handlers_disconnect_by_func (item->priv->screen, G_CALLBACK (on_screen_window_closed), item); + g_signal_handlers_disconnect_by_func (item->priv->window, G_CALLBACK (on_window_workspace_changed), item); + g_signal_handlers_disconnect_by_func (item->priv->window, G_CALLBACK (on_window_state_changed), item); + g_signal_handlers_disconnect_by_func (item->priv->window, G_CALLBACK (on_window_icon_changed), item); + + G_OBJECT_CLASS (task_item_parent_class)->dispose (object); +} + static void task_item_finalize (GObject *object) { @@ -712,6 +728,7 @@ 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->draw = task_item_draw; widget_class->get_preferred_width = task_item_get_preferred_width; -- cgit v1.2.1