static void gncBillTermFree (GncBillTerm *term) { GncBillTerm *child; GList *list; if (!term) return; qof_event_gen (&term->inst, QOF_EVENT_DESTROY, NULL); CACHE_REMOVE (term->name); CACHE_REMOVE (term->desc); remObj (term); if (!qof_instance_get_destroying(term)) PERR("free a billterm without do_free set!"); /* disconnect from parent */ if (term->parent) gncBillTermRemoveChild(term->parent, term); /* disconnect from the children */ for (list = term->children; list; list = list->next) { child = list->data; gncBillTermSetParent(child, NULL); } g_list_free(term->children); /* qof_instance_release(&term->inst); */ g_object_unref (term); }
static void gncTaxTableFree (GncTaxTable *table) { GList *list; GncTaxTable *child; if (!table) return; qof_event_gen (&table->inst, QOF_EVENT_DESTROY, NULL); CACHE_REMOVE (table->name); remObj (table); /* destroy the list of entries */ for (list = table->entries; list; list = list->next) gncTaxTableEntryDestroy (list->data); g_list_free (table->entries); if (!qof_instance_get_destroying(table)) PERR("free a taxtable without do_free set!"); /* disconnect from parent */ if (table->parent) gncTaxTableRemoveChild(table->parent, table); /* disconnect from the children */ for (list = table->children; list; list = list->next) { child = list->data; gncTaxTableSetParent(child, NULL); } g_list_free(table->children); /* qof_instance_release (&table->inst); */ g_object_unref (table); }
void gncBillTermMakeInvisible (GncBillTerm *term) { if (!term) return; gncBillTermBeginEdit (term); term->invisible = TRUE; remObj (term); gncBillTermCommitEdit (term); }