Mercurial > pidgin
diff libpurple/plugin.c @ 15876:80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
ecoffey described the changes:
1) Small tweaks to the loader to bring it up to speed with new mono
versions and API wrapper changes that grim had made. (was in original
patch, just forgot about it :-P)
2) .NET Plugins are now required to define an Id as part of their info.
3) Modified gaim_probe_plugin to check for existence of info->id and to
make sure it's not empty; Prints an error, stores an error in the plugin
and sets plugin->unloadable = TRUE.
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Sat, 24 Mar 2007 06:24:59 +0000 |
| parents | 32c366eeeb99 |
| children | ab2f466b6a13 4a7a13521709 |
line wrap: on
line diff
--- a/libpurple/plugin.c Fri Mar 23 01:47:09 2007 +0000 +++ b/libpurple/plugin.c Sat Mar 24 06:24:59 2007 +0000 @@ -369,6 +369,20 @@ return plugin; } + /* + * Check to make sure a plugin has defined an id. + * Not having this check caused purple_plugin_unload to + * enter an infinite loop in certain situations by passing + * purple_find_plugin_by_id a NULL value. -- ecoffey + */ + if (!plugin->info->id || !strcmp(plugin->info->id, "")) + { + plugin->error = g_strdup_printf(_("This plugin has not defined an ID.")); + purple_debug_error("plugins", "%s is not loadable: info->id is not defined.\n", plugin->path); + plugin->unloadable = TRUE; + return plugin; + } + /* Really old plugins. */ if (plugin->info->magic != PURPLE_PLUGIN_MAGIC) {
