/** * scols_unref_table: * @tb: a pointer to a struct libscols_table instance * * Decreases the refcount of @tb. */ void scols_unref_table(struct libscols_table *tb) { if (tb && (--tb->refcount <= 0)) { scols_table_remove_lines(tb); scols_table_remove_columns(tb); scols_unref_symbols(tb->symbols); free(tb->linesep); free(tb->colsep); free(tb); } }
/** * scols_unref_table: * @tb: a pointer to a struct libscols_table instance * * Decreases the refcount of @tb. When the count falls to zero, the instance * is automatically deallocated. */ void scols_unref_table(struct libscols_table *tb) { if (tb && (--tb->refcount <= 0)) { DBG(TAB, ul_debugobj(tb, "dealloc")); scols_table_remove_lines(tb); scols_table_remove_columns(tb); scols_unref_symbols(tb->symbols); free(tb->linesep); free(tb->colsep); free(tb); } }