Fix memory leak when unloading plugins.

This commit is contained in:
Jan Vidar Krey 2011-12-09 16:39:19 +01:00
parent afda1d7b9d
commit 9377fb537a
1 changed files with 4 additions and 1 deletions

View File

@ -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);