summaryrefslogtreecommitdiff
path: root/mate-window-picker-applet/task-item.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-10-17 16:31:26 +0300
committermonsta <[email protected]>2017-10-17 16:35:10 +0300
commitc34ecbde3086cd1baecda73c381114fa55cb0370 (patch)
treef9655ead8f8554a4a873df66c4bcb74ecda477fe /mate-window-picker-applet/task-item.c
parent0ba73b094b9ab88c3dda585fc7bb3166d56bcbe9 (diff)
downloadmate-netbook-c34ecbde3086cd1baecda73c381114fa55cb0370.tar.bz2
mate-netbook-c34ecbde3086cd1baecda73c381114fa55cb0370.tar.xz
window picker: disconnect signal handlers in dispose function
taken from: https://git.gnome.org/browse/gnome-applets/commit/?id=3736cbfc9483fa36a8f7d620d1e75ad2973bcc08
Diffstat (limited to 'mate-window-picker-applet/task-item.c')
-rw-r--r--mate-window-picker-applet/task-item.c17
1 files changed, 17 insertions, 0 deletions
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
@@ -687,6 +687,22 @@ task_item_setup_atk (TaskItem *item)
}
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)
{
TaskItemPrivate *priv;
@@ -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;