# HG changeset patch # User Richard Laager # Date 1136311974 0 # Node ID 2b53185e5d8f37b70c4e9fd931982673fceb562b # Parent e5f79b206d7e7cde414661d743110537686c36fc [gaim-migrate @ 15042] I think this is the correct handling of the error mode on Win32. committer: Tailor Script diff -r e5f79b206d7e -r 2b53185e5d8f src/plugin.c --- a/src/plugin.c Tue Jan 03 17:55:38 2006 +0000 +++ b/src/plugin.c Tue Jan 03 18:12:54 2006 +0000 @@ -238,13 +238,13 @@ plugin = gaim_plugin_new(has_file_extension(filename, G_MODULE_SUFFIX), filename); + if (plugin->native_plugin) { + const char *error; #ifdef _WIN32 /* Suppress error popups for failing to load plugins */ UINT old_error_mode = SetErrorMode(SEM_FAILCRITICALERRORS); #endif - if (plugin->native_plugin) { - const char *error; /* * We pass G_MODULE_BIND_LOCAL here to prevent symbols from * plugins being added to the global name space. @@ -291,6 +291,10 @@ if (plugin->handle == NULL) { +#ifdef _WIN32 + /* Restore the original error mode */ + SetErrorMode(old_error_mode); +#endif gaim_plugin_destroy(plugin); return NULL; } @@ -319,10 +323,19 @@ plugin->path, error); plugin->handle = NULL; +#ifdef _WIN32 + /* Restore the original error mode */ + SetErrorMode(old_error_mode); +#endif gaim_plugin_destroy(plugin); return NULL; } gaim_init_plugin = unpunned; + +#ifdef _WIN32 + /* Restore the original error mode */ + SetErrorMode(old_error_mode); +#endif } else { loader = find_loader_for_plugin(plugin); @@ -335,11 +348,6 @@ gaim_init_plugin = GAIM_PLUGIN_LOADER_INFO(loader)->probe; } -#ifdef _WIN32 - /* Restore the original error mode */ - SetErrorMode(old_error_mode); -#endif - if (!gaim_init_plugin(plugin) || plugin->info == NULL) { gaim_plugin_destroy(plugin);