Unlink xrefs properly when struct is deleted.
[gedcom-parse.git] / gom / family.c
index 8389569c0a93418e79d775762afc94569a19df4e..9d4a4e562f5c46822409dcb24f9a09af06580646 100644 (file)
@@ -73,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) {