X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=gom%2Fgom.c;h=a3188ac10a4115466112d52ca259980ab7e3a7ea;hb=359ac00a8a5a1d69804380ff5c97c3d01036d1a9;hp=3616e79a241600a531e507fb58a022143d0090c6;hpb=3155d964e15a3c49121c01d2808e5a846779b812;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(); }