Support backend reference counting

parent f65590a8
......@@ -281,6 +281,9 @@ vmod_set__fini(struct vmod_re2_set **setp)
if (vbit_test(set->added[REGEX], i)
&& set->regex[i] != NULL)
vmod_regex__fini(&set->regex[i]);
if (vbit_test(set->added[BACKEND], i)
&& set->backend[i] != NULL)
VRT_Assign_Backend(&set->backend[i], NULL);
}
for (unsigned i = 0; i < NELEMS(set->added); i++)
vbit_destroy(set->added[i]);
......@@ -340,7 +343,8 @@ vmod_set_add(VRT_CTX, struct vmod_re2_set *set, struct VARGS(set_add) *args)
VRT_BACKEND_string(args->backend));
return;
}
set->backend[n] = args->backend;
set->backend[n] = NULL;
VRT_Assign_Backend(&set->backend[n], args->backend);
vbit_set(set->added[BACKEND], n);
}
if (args->valid_integer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment