From: R. Christian McDonald Date: Thu, 19 Jan 2023 21:30:47 +0000 (-0500) Subject: cleanup callbacks that might have been registered by Python script X-Git-Tag: release-1.18.0rc1~24^2~20^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55a28d69466e460c71ab6d1627cf540e98e912a9;p=thirdparty%2Funbound.git cleanup callbacks that might have been registered by Python script --- diff --git a/pythonmod/pythonmod.c b/pythonmod/pythonmod.c index 19b464633..aa8609c58 100644 --- a/pythonmod/pythonmod.c +++ b/pythonmod/pythonmod.c @@ -3,6 +3,7 @@ * * Copyright (c) 2009, Zdenek Vasicek (vasicek AT fit.vutbr.cz) * Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) + * Copyright (c) 2022, Rubicon Communications, LLC (Netgate) * * This software is open source. * @@ -567,6 +568,10 @@ void pythonmod_deinit(struct module_env* env, int id) /* Module is deallocated in Python */ env->modinfo[id] = NULL; + + /* iterate over all possible callback types and clean up each in turn */ + for (int cbtype = 0; cbtype < inplace_cb_types_total; cbtype++) + inplace_cb_delete(env, cbtype, id); } void pythonmod_inform_super(struct module_qstate* qstate, int id, struct module_qstate* super)