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