Second call of gom_parse_file or gom_new_model should clean up model.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sat, 25 Jan 2003 17:57:32 +0000 (17:57 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sat, 25 Jan 2003 17:57:32 +0000 (17:57 +0000)
gom/gom.c

index 3616e79a241600a531e507fb58a022143d0090c6..a3188ac10a4115466112d52ca259980ab7e3a7ea 100644 (file)
--- 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();
 }