Unlink xrefs properly when struct is deleted.
[gedcom-parse.git] / gom / repository.c
index 2d070c676bab02d0080ed0cff2c14a17948fed74..57c6f2889dd5fd5cc8dd9c7a072da904ec71e137 100644 (file)
@@ -40,7 +40,6 @@ DEFINE_DESTROYFUNC(repository, gom_first_repository)
 DEFINE_ADDFUNC(repository, XREF_REPO)
 DEFINE_DELETEFUNC(repository)
 DEFINE_GETXREFFUNC(repository, XREF_REPO)
-DEFINE_MAKELINKFUNC(repository, XREF_REPO)
      
 DEFINE_REC_CB(repository, repo_start)
 DEFINE_STRING_CB(repository, repo_name_start, name)
@@ -59,6 +58,17 @@ void repository_subscribe()
   gedcom_subscribe_to_element(ELT_REPO_NAME, repo_name_start, def_elt_end);
 }
 
+void UNREFALLFUNC(repository)(struct repository *obj)
+{
+  if (obj) {
+    UNREFALLFUNC(address)(obj->address);
+    UNREFALLFUNC(note_sub)(obj->note);
+    UNREFALLFUNC(user_ref_number)(obj->ref);
+    UNREFALLFUNC(change_date)(obj->change_date);
+    UNREFALLFUNC(user_data)(obj->extra);
+  }
+}
+
 void CLEANFUNC(repository)(struct repository* repo)
 {
   if (repo) {