Allow elements out of context in GOM.
[gedcom-parse.git] / gom / source.c
index fc46d0352a270e73dd69f001012602c8a46ae8b8..51c0335443c64d1cce9f470f1e2e500c644768fb 100644 (file)
@@ -43,7 +43,6 @@ DEFINE_DESTROYFUNC(source, gom_first_source)
 DEFINE_ADDFUNC(source, XREF_SOUR)
 DEFINE_DELETEFUNC(source)
 DEFINE_GETXREFFUNC(source, XREF_SOUR)
-DEFINE_MAKELINKFUNC(source, XREF_SOUR)
      
 DEFINE_REC_CB(source, sour_start)
 DEFINE_NULL_CB(source, sour_data_start)
@@ -96,6 +95,22 @@ void source_add_note_to_repo(Gom_ctxt ctxt, struct note_sub* note)
     LINK_CHAIN_ELT(note_sub, sour->repository.note, note);  
 }
 
+void UNREFALLFUNC(source)(struct source *obj)
+{
+  if (obj) {
+    UNREFALLFUNC(source_event)(obj->data.event);
+    UNREFALLFUNC(note_sub)(obj->data.note);
+    unref_xref_value(obj->repository.link);
+    UNREFALLFUNC(note_sub)(obj->repository.note);
+    UNREFALLFUNC(source_description)(obj->repository.description);
+    UNREFALLFUNC(multimedia_link)(obj->mm_link);
+    UNREFALLFUNC(note_sub)(obj->note);
+    UNREFALLFUNC(user_ref_number)(obj->ref);
+    UNREFALLFUNC(change_date)(obj->change_date);
+    UNREFALLFUNC(user_data)(obj->extra);
+  }
+}
+
 void CLEANFUNC(source)(struct source* sour)
 {
   if (sour) {