From 9377fb537a7ce56ce92d35324a3692f37bd76a6f Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Fri, 9 Dec 2011 16:39:19 +0100 Subject: [PATCH] Fix memory leak when unloading plugins. --- src/core/pluginloader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/pluginloader.c b/src/core/pluginloader.c index 8e72fa7..6553ac5 100644 --- a/src/core/pluginloader.c +++ b/src/core/pluginloader.c @@ -74,8 +74,11 @@ struct uhub_plugin* plugin_open(const char* filename) void plugin_close(struct uhub_plugin* plugin) { + struct plugin_hub_internals* internals = (struct plugin_hub_internals*) plugin->internals; + LOG_PLUGIN("plugin_close: \"%s\"", plugin->filename); - hub_free(plugin->internals); + plugin_callback_data_destroy(internals->callback_data); + hub_free(internals); #ifdef HAVE_DLOPEN dlclose(plugin->handle);