From: Colin Vidal Date: Wed, 26 Nov 2025 13:33:02 +0000 (+0100) Subject: remove `references` from cfg_parser_t X-Git-Tag: v9.21.17~63^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc82db7b82262148f02218fb9702bb5bf28b43b5;p=thirdparty%2Fbind9.git 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`. --- diff --git a/lib/isccfg/include/isccfg/grammar.h b/lib/isccfg/include/isccfg/grammar.h index bee2a224694..0018942fb5b 100644 --- a/lib/isccfg/include/isccfg/grammar.h +++ b/lib/isccfg/include/isccfg/grammar.h @@ -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 */ diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 35721eb2f1f..188d34226b8 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -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