s->active = NULL;
HMAPX_FOR_EACH_SAFE (ds, node, next, &s->datasets)
dataset_destroy (ds);
+ hmapx_destroy (&s->datasets);
free (s->syntax_encoding);
free (s);
}
if (old == s->active)
s->active = ds;
if (old != NULL)
- session_remove_dataset (s, old);
+ {
+ session_remove_dataset (s, old);
+ dataset_destroy (old);
+ }
hmapx_insert (&s->datasets, ds,
utf8_hash_case_string (dataset_name (ds), 0));
return NULL;
}
-/* Returns an identifier that is is not currently in use as a dataset name.
+/* Returns an identifier that is not currently in use as a dataset name.
The caller must free the returned identifier, with free(). */
char *
session_generate_dataset_name (struct session *s)