Fix an assertion when activating apps a second time
authorMatthias Clasen <mclasen@redhat.com>
Sun, 11 Dec 2011 17:05:23 +0000 (12:05 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 11 Dec 2011 17:05:23 +0000 (12:05 -0500)
This was causing the following critical when running bloatpad twice:
GLib-CRITICAL **: g_hash_table_insert_internal: assertion `hash_table != NULL' failed

gio/gdbusactiongroup.c

index e7c94631306701095b00b26e95e6bee0337098c1..d84e239cad441d023b8376ae4686989e26742f92 100644 (file)
@@ -494,6 +494,9 @@ g_dbus_action_group_sync (GDBusActionGroup  *group,
       GVariantIter *iter;
       ActionInfo *action;
 
+      g_assert (group->actions == NULL);
+      group->actions = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, action_info_free);
+
       g_variant_get (reply, "(a{s(bgav)})", &iter);
       while ((action = action_info_new_from_iter (iter)))
         g_hash_table_insert (group->actions, action->name, action);