From: Peter Verthez Date: Sat, 25 Jan 2003 17:57:32 +0000 (+0000) Subject: Second call of gom_parse_file or gom_new_model should clean up model. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=e26ad7230160f52df0f5788c805cc9f5ab184806;p=gedcom-parse.git Second call of gom_parse_file or gom_new_model should clean up model. --- diff --git a/gom/gom.c b/gom/gom.c index 3616e79..a3188ac 100644 --- a/gom/gom.c +++ b/gom/gom.c @@ -103,15 +103,29 @@ void subscribe_all() } } +int gom_active = 0; + int gom_parse_file(const char* file_name) { - subscribe_all(); + if (gom_active) { + gom_cleanup(); + } + else { + subscribe_all(); + } + gom_active = 1; return gedcom_parse_file(file_name); } int gom_new_model() { - subscribe_all(); + if (gom_active) { + gom_cleanup(); + } + else { + subscribe_all(); + } + gom_active = 1; return gedcom_new_model(); }