Commit 0ceae250 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

class-group: add a weak reference callback to window

When wnck_shutdown is called all windows are destroyed, but nothing
removes signal handlers from hash tables. When class group is destroyed
it will try to remove signal handlers from already destroyed windows.

Use weak reference callback to remove obsolete signal handlers from
hash tables.

#141
parent d3a714db
Pipeline #103893 passed with stage
in 5 minutes and 53 seconds
......@@ -496,6 +496,20 @@ update_class_group_name (WnckWindow *window,
set_name (class_group);
}
static void
window_weak_notify_cb (gpointer data,
GObject *where_the_window_was)
{
WnckClassGroup *class_group;
WnckClassGroupPrivate *priv;
class_group = WNCK_CLASS_GROUP (data);
priv = class_group->priv;
g_hash_table_remove (priv->window_icon_handlers, where_the_window_was);
g_hash_table_remove (priv->window_name_handlers, where_the_window_was);
}
/**
* _wnck_class_group_add_window:
* @class_group: a #WnckClassGroup.
......@@ -534,6 +548,8 @@ _wnck_class_group_add_window (WnckClassGroup *class_group,
window,
(gpointer) signal_id);
g_object_weak_ref (G_OBJECT (window), window_weak_notify_cb, class_group);
set_name (class_group);
set_icon (class_group);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment