X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Fcore%2Fplugin.c;h=18ea82c77fc8475d73dfb9e4a37b8a7a693443fc;hp=6f6beeb13935e5fff22610aa5d62c599ce2f8cfc;hb=7261c016072283d7dce6e4fbac52e6b9c696d015;hpb=a052e2bb32b5bc092b5a4a9cff9a3c0b6a3a119f diff --git a/src/core/plugin.c b/src/core/plugin.c index 6f6beeb..18ea82c 100644 --- a/src/core/plugin.c +++ b/src/core/plugin.c @@ -239,8 +239,10 @@ plugin_unregister_by_name(const char *plugin_name) } } - sdb_log(SDB_LOG_INFO, "core: Unloading module %s", plugin_name); obj = sdb_llist_remove_by_name(all_plugins, plugin_name); + if (obj->ref_cnt <= 1) + sdb_log(SDB_LOG_INFO, "core: Unloading module %s", plugin_name); + /* else: other callbacks still reference it */ sdb_object_deref(obj); } /* plugin_unregister_by_name */