Use def_elt_end instead of destroying the context directly.
[gedcom-parse.git] / gom / family.c
index 9375b1ff209dd172cb583eacc29aa1c6de3df4ed..9d4a4e562f5c46822409dcb24f9a09af06580646 100644 (file)
@@ -45,7 +45,6 @@ DEFINE_DESTROYFUNC(family, gom_first_family)
 DEFINE_ADDFUNC(family, XREF_FAM)
 DEFINE_DELETEFUNC(family)
 DEFINE_GETXREFFUNC(family, XREF_FAM)
-DEFINE_MAKELINKFUNC(family, XREF_FAM)
      
 DEFINE_REC_CB(family, fam_start)
 DEFINE_XREF_CB(family, fam_husb_start, husband, individual)
@@ -74,6 +73,24 @@ void family_subscribe()
   gedcom_subscribe_to_element(ELT_FAM_SUBM, fam_subm_start, def_elt_end);
 }
 
+void UNREFALLFUNC(family)(struct family *fam)
+{
+  if (fam) {
+    UNREFALLFUNC(event)(fam->event);
+    unref_xref_value(fam->husband);
+    unref_xref_value(fam->wife);
+    UNREFALLFUNC(xref_list)(fam->children);
+    UNREFALLFUNC(xref_list)(fam->submitters);
+    UNREFALLFUNC(lds_event)(fam->lds_spouse_sealing);
+    UNREFALLFUNC(source_citation)(fam->citation);
+    UNREFALLFUNC(multimedia_link)(fam->mm_link);
+    UNREFALLFUNC(note_sub)(fam->note);
+    UNREFALLFUNC(user_ref_number)(fam->ref);
+    UNREFALLFUNC(change_date)(fam->change_date);
+    UNREFALLFUNC(user_data)(fam->extra);
+  }
+}
+
 void CLEANFUNC(family)(struct family* fam)
 {
   if (fam) {