THROWF(tracing_error, 0, "can't create a new type with name or key equal nullptr");
}
- type_t ret = xbt_new0(s_type_t, 1);
+ type_t ret = xbt_new0(s_type, 1);
ret->name = xbt_strdup (typeNameBuff);
ret->father = father;
ret->kind = kind;
void PJ_type_free (type_t type)
{
- val_t value;
+ value* val;
char *value_name;
xbt_dict_cursor_t cursor = nullptr;
- xbt_dict_foreach(type->values, cursor, value_name, value) {
- XBT_DEBUG("free value %s, child of %s", value->name, value->father->name);
- xbt_free(value->name);
- xbt_free(value->color);
- xbt_free(value->id);
- xbt_free(value);
- //PJ_value_free (value);
+ xbt_dict_foreach (type->values, cursor, value_name, val) {
+ XBT_DEBUG("free value %s, child of %s", val->name, val->father->name);
+ delete val;
}
xbt_dict_free (&type->values);
xbt_free (type->name);
type = nullptr;
}
-static void recursiveDestroyType (type_t type)
+void recursiveDestroyType (type_t type)
{
XBT_DEBUG("recursiveDestroyType %s", type->name);
xbt_dict_cursor_t cursor = nullptr;
PJ_type_free(type);
}
-void PJ_type_free_all ()
-{
- recursiveDestroyType (PJ_type_get_root());
- rootType = nullptr;
-}
-
type_t PJ_type_get (const char *name, type_t father)
{
type_t ret = PJ_type_get_or_null (name, father);