projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
str: New function ds_put_substring_multiple().
[pspp]
/
src
/
data
/
session.c
diff --git
a/src/data/session.c
b/src/data/session.c
index 56aa31a91cd581036890e312c04bb83bdd30de5b..90922f3b244e455b6b88b401b5bcf42ad549b8b4 100644
(file)
--- a/
src/data/session.c
+++ b/
src/data/session.c
@@
-69,6
+69,7
@@
session_destroy (struct session *s)
s->active = NULL;
HMAPX_FOR_EACH_SAFE (ds, node, next, &s->datasets)
dataset_destroy (ds);
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);
}
free (s->syntax_encoding);
free (s);
}
@@
-96,7
+97,10
@@
session_add_dataset (struct session *s, struct dataset *ds)
if (old == s->active)
s->active = ds;
if (old != NULL)
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));
hmapx_insert (&s->datasets, ds,
utf8_hash_case_string (dataset_name (ds), 0));
@@
-174,7
+178,7
@@
session_get_dataset_by_seqno (const struct session *s, unsigned int seqno)
return NULL;
}
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)
The caller must free the returned identifier, with free(). */
char *
session_generate_dataset_name (struct session *s)