--- a/gplugin/gplugin-manager.c Mon Mar 09 21:33:40 2020 -0500
+++ b/gplugin/gplugin-manager.c Mon Mar 09 21:34:41 2020 -0500
@@ -206,6 +206,36 @@
+gplugin_manager_foreach_unload_plugin( + G_GNUC_UNUSED gpointer data) + gchar *id = (gchar *)key; + for(l = (GList *)value; l; l = l->next) { + GPluginPlugin *plugin = GPLUGIN_PLUGIN(l->data); + GPluginLoader *loader = NULL; + if(gplugin_plugin_get_state(plugin) != GPLUGIN_PLUGIN_STATE_LOADED) { + loader = gplugin_plugin_get_loader(plugin); + if(!gplugin_loader_unload_plugin(loader, plugin, &error)) { + "failed to unload plugin with id %s: %s", + error ? error->message : "unknown"); + g_object_unref(G_OBJECT(loader)); /******************************************************************************
*****************************************************************************/
@@ -738,6 +768,7 @@
info = gplugin_plugin_get_info(plugin);
dependencies = gplugin_plugin_info_get_dependencies(info);
+ g_object_unref(G_OBJECT(info)); if(dependencies == NULL) {
@@ -797,14 +828,10 @@
g_slist_free_full(ret, g_object_unref);
- g_object_unref(G_OBJECT(info));
- g_object_unref(G_OBJECT(info));
@@ -942,7 +969,7 @@
/******************************************************************************
+ * GObject Implementation *****************************************************************************/
gplugin_manager_finalize(GObject *obj)
@@ -952,6 +979,12 @@
g_queue_free_full(manager->paths, g_free);
+ /* unload all of the loaded plugins */ + gplugin_manager_foreach_unload_plugin, /* free all the data in the plugins hash table and destroy it */
g_hash_table_foreach_remove(