+static void recursiveDestroyContainer (container_t container)
+{
+ xbt_dict_cursor_t cursor = NULL;
+ container_t child;
+ char *child_name;
+ xbt_dict_foreach(container->children, cursor, child_name, child) {
+ recursiveDestroyContainer (child);
+ }
+ destroyContainer (container);
+}
+
+static void recursiveDestroyType (type_t type)
+{
+ xbt_dict_cursor_t cursor = NULL;
+ type_t child;
+ char *child_name;
+ xbt_dict_foreach(type->children, cursor, child_name, child) {
+ recursiveDestroyType (child);
+ }
+ xbt_free (type->name);
+ xbt_free (type->id);
+ xbt_free (type->children);
+ xbt_free (type);
+ type = NULL;
+}
+
+void destroyAllContainers ()
+{
+ if (getRootContainer()) recursiveDestroyContainer (getRootContainer());
+ if (getRootType()) recursiveDestroyType (getRootType());
+ rootContainer = NULL;
+ rootType = NULL;
+}
+