Use def_elt_end instead of destroying the context directly.
[gedcom-parse.git] / gom / event.c
index af6e9129c11ea417c23de76f6e744946db4dec2e..3b45643c06265bcd735d176cf1e25010009533f5 100644 (file)
@@ -126,6 +126,10 @@ Gedcom_ctxt sub_attr_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(event)
+DEFINE_SUB_ADDFUNC(event)
+DEFINE_SUB_FINDFUNC(event)
+DEFINE_SUB_REMOVEFUNC(event)
+DEFINE_SUB_MOVEFUNC(event)
      
 DEFINE_STRING_CB(event, sub_evt_type_start, type)
 DEFINE_DATE_CB(event, sub_evt_date_start, date)
@@ -222,6 +226,22 @@ void event_subscribe()
                              sub_evt_caus_start, def_elt_end);
 }
 
+void UNREFALLFUNC(event)(struct event* obj)
+{
+  if (obj) {
+    struct event* runner;
+    for (runner = obj; runner; runner = runner->next) {
+      UNREFALLFUNC(place)(runner->place);
+      UNREFALLFUNC(address)(runner->address);
+      UNREFALLFUNC(source_citation)(runner->citation);
+      UNREFALLFUNC(multimedia_link)(runner->mm_link);
+      UNREFALLFUNC(note_sub)(runner->note);
+      unref_xref_value(runner->family);
+      UNREFALLFUNC(user_data)(runner->extra);
+    }
+  }
+}
+
 void CLEANFUNC(event)(struct event* evt)
 {
   if (evt) {