summaryrefslogtreecommitdiff
path: root/mate-window-picker-applet
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-10-17 16:31:26 +0300
committermonsta <[email protected]>2017-10-17 16:31:26 +0300
commitb1f7d011419a9d621ccd8d3c28f4ed2837876279 (patch)
tree964769bb812f4bfc0742c19b6d88cd3f1f887c7e /mate-window-picker-applet
parent1066d9619a1fb10a80b97ecf08887e77e4b93467 (diff)
downloadmate-netbook-b1f7d011419a9d621ccd8d3c28f4ed2837876279.tar.bz2
mate-netbook-b1f7d011419a9d621ccd8d3c28f4ed2837876279.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')
-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;