Code

plugin: Only log a message when actually unloading a module.
authorSebastian Harl <sh@tokkee.org>
Fri, 18 Apr 2014 12:42:08 +0000 (14:42 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 18 Apr 2014 12:42:08 +0000 (14:42 +0200)
src/core/plugin.c

index 6f6beeb13935e5fff22610aa5d62c599ce2f8cfc..18ea82c77fc8475d73dfb9e4a37b8a7a693443fc 100644 (file)
@@ -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 */