Mercurial > pidgin.yaz
comparison libpurple/plugin.c @ 21193:67940cc52dc4
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.
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Sun, 07 Oct 2007 14:25:17 +0000 |
| parents | 5d93e197ba44 |
| children | a4a55a096ac8 |
comparison
equal
deleted
inserted
replaced
| 21192:5d93e197ba44 | 21193:67940cc52dc4 |
|---|---|
| 674 plugin->dependent_plugins = g_list_remove(plugin->dependent_plugins, dep_name); | 674 plugin->dependent_plugins = g_list_remove(plugin->dependent_plugins, dep_name); |
| 675 } | 675 } |
| 676 } | 676 } |
| 677 } | 677 } |
| 678 | 678 |
| 679 /* Remove this plugin from each dependency's dependent_plugins list. */ | |
| 680 for (l = plugin->info->dependencies; l != NULL; l = l->next) | |
| 681 { | |
| 682 const char *dep_name = (const char *)l->data; | |
| 683 PurplePlugin *dependency; | |
| 684 | |
| 685 dependency = purple_plugins_find_with_id(dep_name); | |
| 686 | |
| 687 if (dependency != NULL) | |
| 688 dependency->dependent_plugins = g_list_remove(dependency->dependent_plugins, plugin->info->id); | |
| 689 else | |
| 690 purple_debug_error("plugins", "Unable to remove from dependency list for %s\n", dep_name); | |
| 691 } | |
| 692 | |
| 679 if (plugin->native_plugin) { | 693 if (plugin->native_plugin) { |
| 680 if (plugin->info->unload != NULL) | 694 if (plugin->info->unload != NULL) |
| 681 if (!plugin->info->unload(plugin)) | 695 if (!plugin->info->unload(plugin)) |
| 682 return FALSE; | 696 return FALSE; |
| 683 | 697 |
