# HG changeset patch # User Richard Laager # Date 1137964480 0 # Node ID 9d8025ec5e23c4061cfe9c0b76e81f190cf6cd9d # Parent c1b2ba353e85e2096dcf970859729744c1fce635 [gaim-migrate @ 15345] Etan is right about the dependent plugin unloading. committer: Tailor Script diff -r c1b2ba353e85 -r 9d8025ec5e23 src/plugin.c --- a/src/plugin.c Sun Jan 22 21:02:52 2006 +0000 +++ b/src/plugin.c Sun Jan 22 21:14:40 2006 +0000 @@ -607,7 +607,7 @@ gaim_plugin_unload(GaimPlugin *plugin) { #ifdef GAIM_PLUGINS - GList *l, *l_next; + GList *l; g_return_val_if_fail(plugin != NULL, FALSE); @@ -626,17 +626,11 @@ plugin->loaded = FALSE; /* Unload all plugins that depend on this plugin. */ - /* XXX Does this want to be while (plugin->dependent_plugins != NULL) - * instead of this loop? I fixed it to get l->next before calling - * gaim_plugin_unload (which can change the list here). This worked - * much better for me but I'm not 100% sure it will always work. */ - for (l = plugin->dependent_plugins; l != NULL; l = l_next) + while ((l = plugin->dependent_plugins) != NULL) { const char * dep_name = (const char *)l->data; GaimPlugin *dep_plugin; - l_next = l->next; - dep_plugin = gaim_plugins_find_with_id(dep_name); if (dep_plugin != NULL && gaim_plugin_is_loaded(dep_plugin))