Re-add a loop I removed in bd18a055f95361c42ad89eaf5bb5d871db4c4727. It's next.minor

Sun, 07 Oct 2007 14:25:17 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Sun, 07 Oct 2007 14:25:17 +0000
branch
next.minor
changeset 20864
d2bdc834d515
parent 20863
1fb9e7564f5d
child 20865
e35ee4fd6d45

Re-add a loop I removed in bd18a055f95361c42ad89eaf5bb5d871db4c4727. It's
necessary to update the dependent_plugins of each dependency of a plugin
being unloaded. Without this, unloading the dependency later will result
in a crash.

libpurple/plugin.c file | annotate | diff | comparison | revisions
--- a/libpurple/plugin.c	Sat Oct 06 23:07:45 2007 +0000
+++ b/libpurple/plugin.c	Sun Oct 07 14:25:17 2007 +0000
@@ -676,6 +676,20 @@
 		}
 	}
 
+	/* Remove this plugin from each dependency's dependent_plugins list. */
+	for (l = plugin->info->dependencies; l != NULL; l = l->next)
+	{
+		const char *dep_name = (const char *)l->data;
+		PurplePlugin *dependency;
+
+		dependency = purple_plugins_find_with_id(dep_name);
+
+		if (dependency != NULL)
+			dependency->dependent_plugins = g_list_remove(dependency->dependent_plugins, plugin->info->id);
+		else
+			purple_debug_error("plugins", "Unable to remove from dependency list for %s\n", dep_name);
+	}
+
 	if (plugin->native_plugin) {
 		if (plugin->info->unload != NULL)
 			if (!plugin->info->unload(plugin))

mercurial