/* Destroy a value object */ void value_destroy(struct value_obj *vo) { TRACE_FLOW_ENTRY(); if (vo) { /* Free arrays if any */ value_destroy_arrays(vo->raw_lines, vo->raw_lengths); /* Free the simple buffer if any */ simplebuffer_free(vo->unfolded); /* Function checks validity inside */ ini_comment_destroy(vo->ic); free(vo); } TRACE_FLOW_EXIT(); }
/* Destroy parser object */ static void parser_destroy(struct parser_obj *po) { TRACE_FLOW_ENTRY(); if(po) { col_destroy_queue(po->queue); col_destroy_collection_with_cb(po->sec, ini_cleanup_cb, NULL); ini_comment_destroy(po->ic); value_destroy_arrays(po->raw_lines, po->raw_lengths); if (po->last_read) free(po->last_read); if (po->key) free(po->key); col_destroy_collection_with_cb(po->top, ini_cleanup_cb, NULL); free(po); } TRACE_FLOW_EXIT(); }