if (! ctxt)
NO_CONTEXT;
else {
- struct note_sub *note = (struct note_sub *)malloc(sizeof(struct note_sub));
- if (! note)
- MEMORY_ERROR;
- else {
- memset (note, 0, sizeof(struct note_sub));
+ struct note_sub *note = SUB_MAKEFUNC(note_sub)();
+ if (note) {
if (GEDCOM_IS_XREF_PTR(parsed_value))
note->reference = GEDCOM_XREF_PTR(parsed_value);
return (Gedcom_ctxt)result;
}
+DEFINE_SUB_MAKEFUNC(note_sub)
+
DEFINE_STRING_END_CB(note_sub, sub_note_end, text)
DEFINE_ADDFUNC2(note_sub, source_citation, citation)
gedcom_subscribe_to_element(ELT_SUB_NOTE, sub_note_start, sub_note_end);
}
+void UNREFALLFUNC(note_sub)(struct note_sub* obj)
+{
+ if (obj) {
+ struct note_sub* runner;
+ for (runner = obj; runner; runner = runner->next) {
+ unref_xref_value(runner->reference);
+ UNREFALLFUNC(source_citation)(runner->citation);
+ UNREFALLFUNC(user_data)(runner->extra);
+ }
+ }
+}
+
void CLEANFUNC(note_sub)(struct note_sub* note)
{
if (note) {