summaryrefslogtreecommitdiff
path: root/libwnck/class-group.c
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2012-01-18 16:51:13 +0100
committerVincent Untz <vuntz@gnome.org>2012-01-30 15:05:40 +0100
commit040a3b358840a8ef32f9f64792bb41a5327cd81c (patch)
tree3d626f7874a2e202ad17567252e5f838140f5db0 /libwnck/class-group.c
parent085a93c7fd1f235def445823b06ffef5b6343810 (diff)
downloadlibwnck-040a3b358840a8ef32f9f64792bb41a5327cd81c.tar.gz
core: Add wnck_shutdown()
Add wnck_shutdown() method that stops listening to events and tear down all resources from libwnck. This should be done if you are not going to need the state change notifications for an extended period of time, to avoid wakeups with every key and focus event. After this all Wnck object references you might still hold are invalid. https://bugzilla.gnome.org/show_bug.cgi?id=642692
Diffstat (limited to 'libwnck/class-group.c')
-rw-r--r--libwnck/class-group.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libwnck/class-group.c b/libwnck/class-group.c
index f0fee23..56e48d2 100644
--- a/libwnck/class-group.c
+++ b/libwnck/class-group.c
@@ -636,3 +636,22 @@ wnck_class_group_get_mini_icon (WnckClassGroup *class_group)
return class_group->priv->mini_icon;
}
+
+static void
+_wnck_class_iter_destroy_class_group (gpointer key,
+ gpointer value,
+ gpointer user_data)
+{
+ g_object_unref (WNCK_CLASS_GROUP (value));
+}
+
+void
+_wnck_class_group_shutdown_all (void)
+{
+ if (class_group_hash != NULL)
+ {
+ g_hash_table_foreach (class_group_hash, _wnck_class_iter_destroy_class_group, NULL);
+ g_hash_table_destroy (class_group_hash);
+ class_group_hash = NULL;
+ }
+}