Only try to delete address if present.
[gedcom-parse.git] / gom / address.c
index fa8a3ee0a98eba2d3ae0aed727177984f8902186..553fa12cb835d01773f36556efba2fa81c345776 100644 (file)
@@ -82,7 +82,7 @@ Gedcom_ctxt sub_addr_cont_start(_ELT_PARAMS_)
 }
 
 DEFINE_SUB_MAKEFUNC(address)
-DEFINE_SUB_ADDFUNC(address)
+DEFINE_SUB_SETFUNC(address)
 DEFINE_SUB_DELETEFUNC(address)
 
 DEFINE_STRING_END_CB(address, sub_addr_end, full_label)
@@ -147,6 +147,13 @@ void address_subscribe()
   gedcom_subscribe_to_element(ELT_SUB_PHON, sub_phon_start, def_elt_end);
 }
 
+void UNREFALLFUNC(address)(struct address *address)
+{
+  if (address) {
+    UNREFALLFUNC(user_data)(address->extra);
+  }
+}
+
 void CLEANFUNC(address)(struct address *address)
 {
   if (address) {