# HG changeset patch # User Richard Laager # Date 1191767117 0 # Node ID 67940cc52dc4b50cf438c0f92d95d7388dd0a518 # Parent 5d93e197ba44267b4b3d4a077d7bd9fdbd794f3b Re-add a loop I removed in b5acf346a6ed692acc613d71a9ebbfcf4726cc63. 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. diff -r 5d93e197ba44 -r 67940cc52dc4 libpurple/plugin.c --- 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))