summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a2c0ff8)
raw | patch | inline | side by side (parent: a2c0ff8)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 12 May 2015 20:40:27 +0000 (22:40 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 19 May 2015 15:41:27 +0000 (17:41 +0200) |
The recursive nature of this function made it difficult to free the root
node of the config tree. Splitting it in 2 allows to work around this
problem.
node of the config tree. Splitting it in 2 allows to work around this
problem.
src/java.c | patch | blob | history | |
src/liboconfig/oconfig.c | patch | blob | history |
diff --git a/src/java.c b/src/java.c
index 83cd353f0e1f6a06667c35b474467207f02b92f9..10d837e6701fcc9f4532b0a4f19c4c5e12a03532 100644 (file)
--- a/src/java.c
+++ b/src/java.c
if (config_block != NULL)
{
-
cjni_config_perform (config_block);
oconfig_free (config_block);
- config_block = NULL;
}
if (jvm == NULL)
index 629775ab8c44dd55de5d930d0189168546d455c3..181eadd26282b8b0506baf3504310cb48c45b469 100644 (file)
--- a/src/liboconfig/oconfig.c
+++ b/src/liboconfig/oconfig.c
return (ci_copy);
} /* oconfig_item_t *oconfig_clone */
-void oconfig_free (oconfig_item_t *ci)
+void oconfig_free_all (oconfig_item_t *ci)
{
int i;
free (ci->values);
for (i = 0; i < ci->children_num; i++)
- oconfig_free (ci->children + i);
+ oconfig_free_all (ci->children + i);
if (ci->children != NULL)
free (ci->children);
}
+void oconfig_free (oconfig_item_t *ci)
+{
+ oconfig_free_all (ci);
+ free (ci);
+ ci = NULL;
+}
+
/*
* vim:shiftwidth=2:tabstop=8:softtabstop=2:fdm=marker
*/