X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gom%2Fgom.c;fp=gom%2Fgom.c;h=a3188ac10a4115466112d52ca259980ab7e3a7ea;hb=e26ad7230160f52df0f5788c805cc9f5ab184806;hp=3616e79a241600a531e507fb58a022143d0090c6;hpb=693aef651b0b5790528107a660651664dbcc2ba0;p=gedcom-parse.git 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(); }