diff --git a/include/dap_chain_plugins_list.h b/include/dap_chain_plugins_list.h index c0ae76c19f9dadd27a55991478e33e25736de715..7eec9695ed9afaf09efee441b6c1110854d14831 100644 --- a/include/dap_chain_plugins_list.h +++ b/include/dap_chain_plugins_list.h @@ -31,6 +31,7 @@ dap_chain_plugin_list_module_t* dap_chain_plugins_list_get(); bool dap_chain_plugins_list_check_load_plugins(dap_chain_plugins_list_char_t *list); void dap_chain_plugins_list_add(PyObject *module, const char *name); +void dap_chain_plugins_list_name_del(const char *name); #ifdef __cplusplus extern "C" { diff --git a/src/dap_chain_plugins_list.c b/src/dap_chain_plugins_list.c index 69ef5203523a41c86b66a366e34398512853464c..cac4d70334b147c176f2ea24d351118ebc9fb448 100644 --- a/src/dap_chain_plugins_list.c +++ b/src/dap_chain_plugins_list.c @@ -38,3 +38,20 @@ bool dap_chain_plugins_list_check_load_plugins(dap_chain_plugins_list_char_t *li return true; } +void dap_chain_plugins_list_name_del(const char *name){ + dap_chain_plugin_list_module_t *plugin; + dap_chain_plugin_list_module_t *tmp; + bool plugin_searcging = false; + LL_FOREACH_SAFE(m_dap_chain_plugins_module_list, plugin, tmp){ + if (strcmp(plugin->name, name) == 0){ + DAP_FREE(plugin->name); + Py_XDECREF(plugin->obj_module); + LL_DELETE(m_dap_chain_plugins_module_list, plugin); + plugin_searcging = true; + } + } + if (!plugin_searcging){ + log_it(L_WARNING, "Can't searching plugins %s for delete", name); + } +} +