From e26ad7230160f52df0f5788c805cc9f5ab184806 Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sat, 25 Jan 2003 17:57:32 +0000 Subject: [PATCH] Second call of gom_parse_file or gom_new_model should clean up model. --- gom/gom.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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(); } -- 2.30.2