# HG changeset patch # User Daniel Atallah # Date 1185249141 0 # Node ID f05360b5470d0211034118ff83461ca33c513be8 # Parent 672dd03f538a32b5cf5a452552e3b5863c7cdc33 Fix core plugin dependency registering for gtkbuddynote to happen in plugin_init() so that it can work correctly. Add an additional sanity check in the core plugin unloading so that messed up dependency registrations don't cause crashes in the future. Thanks to deryni for helping figure this out. diff -r 672dd03f538a -r f05360b5470d libpurple/plugin.c --- a/libpurple/plugin.c Mon Jul 23 23:56:01 2007 +0000 +++ b/libpurple/plugin.c Tue Jul 24 03:52:21 2007 +0000 @@ -692,7 +692,10 @@ dependency = purple_plugins_find_with_id(dep_name); - dependency->dependent_plugins = g_list_remove(dependency->dependent_plugins, plugin->info->id); + 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) { diff -r 672dd03f538a -r f05360b5470d pidgin/plugins/gtkbuddynote.c --- a/pidgin/plugins/gtkbuddynote.c Mon Jul 23 23:56:01 2007 +0000 +++ b/pidgin/plugins/gtkbuddynote.c Tue Jul 24 03:52:21 2007 +0000 @@ -107,8 +107,6 @@ bninfo->flags = PURPLE_PLUGIN_FLAG_INVISIBLE; - info.dependencies = g_list_append(info.dependencies, - "core-plugin_pack-buddynote"); /* If non-gtk buddy note plugin is loaded, but we are not, then load * ourselves, otherwise people upgrading from pre-gtkbuddynote days @@ -134,6 +132,9 @@ /* Use g_idle_add so that the rest of the plugins can get loaded * before we do our check. */ g_idle_add(check_for_buddynote, plugin); + + info.dependencies = g_list_append(info.dependencies, + "core-plugin_pack-buddynote"); } PURPLE_INIT_PLUGIN(gtkbuddynote, init_plugin, info)