remove references from cfg_parser_t

The parser used to be referenced by `cfg_obj_t`, but not anymore.
Removing the reference counter from `cfg_parser_t`.
This commit is contained in:
Colin Vidal 2025-11-26 14:33:02 +01:00
parent 870b7329f8
commit bc82db7b82
2 changed files with 9 additions and 16 deletions

View file

@ -288,9 +288,6 @@ struct cfg_parser {
* from one token to the next.
*/
unsigned int flags;
/*%< Reference counter */
isc_refcount_t references;
};
/* Parser context flags */

View file

@ -692,8 +692,6 @@ parser_create(isc_mem_t *mctx, cfg_parser_t **ret) {
pctx->mctx = NULL;
isc_mem_attach(mctx, &pctx->mctx);
isc_refcount_init(&pctx->references, 1);
pctx->lexer = NULL;
pctx->seen_eof = false;
pctx->ungotten = false;
@ -737,17 +735,15 @@ parser_destroy(cfg_parser_t **pctxp) {
pctx = *pctxp;
*pctxp = NULL;
if (isc_refcount_decrement(&pctx->references) == 1) {
isc_lex_destroy(&pctx->lexer);
/*
* Cleaning up open_files does not
* close the files; that was already done
* by closing the lexer.
*/
CLEANUP_OBJ(pctx->open_files);
CLEANUP_OBJ(pctx->closed_files);
isc_mem_putanddetach(&pctx->mctx, pctx, sizeof(*pctx));
}
isc_lex_destroy(&pctx->lexer);
/*
* Cleaning up open_files does not
* close the files; that was already done
* by closing the lexer.
*/
CLEANUP_OBJ(pctx->open_files);
CLEANUP_OBJ(pctx->closed_files);
isc_mem_putanddetach(&pctx->mctx, pctx, sizeof(*pctx));
}
static isc_result_t