Mercurial > pidgin.yaz
comparison src/plugin.c @ 5443:07358c067495
[gaim-migrate @ 5825]
fix a segfault for solaris and others
committer: Tailor Script <tailor@pidgin.im>
| author | Nathan Walp <nwalp@pidgin.im> |
|---|---|
| date | Sun, 18 May 2003 22:35:14 +0000 |
| parents | ad445074d239 |
| children | 9442e8d0b21d |
comparison
equal
deleted
inserted
replaced
| 5442:702071b23c06 | 5443:07358c067495 |
|---|---|
| 181 return plugin; | 181 return plugin; |
| 182 | 182 |
| 183 plugin = gaim_plugin_new(is_so_file(filename, PLUGIN_EXT), filename); | 183 plugin = gaim_plugin_new(is_so_file(filename, PLUGIN_EXT), filename); |
| 184 | 184 |
| 185 if (plugin->native_plugin) { | 185 if (plugin->native_plugin) { |
| 186 char *error; | |
| 186 plugin->handle = g_module_open(filename, 0); | 187 plugin->handle = g_module_open(filename, 0); |
| 187 | 188 |
| 188 if (plugin->handle == NULL) { | 189 if (plugin->handle == NULL) { |
| 190 error = g_module_error(); | |
| 189 gaim_debug(GAIM_DEBUG_ERROR, "plugins", "%s is unloadable: %s\n", | 191 gaim_debug(GAIM_DEBUG_ERROR, "plugins", "%s is unloadable: %s\n", |
| 190 plugin->path, g_module_error()); | 192 plugin->path, error ? error : "Unknown error."); |
| 191 | 193 |
| 192 gaim_plugin_destroy(plugin); | 194 gaim_plugin_destroy(plugin); |
| 193 | 195 |
| 194 return NULL; | 196 return NULL; |
| 195 } | 197 } |
| 197 if (!g_module_symbol(plugin->handle, "gaim_init_plugin", | 199 if (!g_module_symbol(plugin->handle, "gaim_init_plugin", |
| 198 (gpointer *)&gaim_init_plugin)) { | 200 (gpointer *)&gaim_init_plugin)) { |
| 199 g_module_close(plugin->handle); | 201 g_module_close(plugin->handle); |
| 200 plugin->handle = NULL; | 202 plugin->handle = NULL; |
| 201 | 203 |
| 204 error = g_module_error(); | |
| 202 gaim_debug(GAIM_DEBUG_ERROR, "plugins", "%s is unloadable: %s\n", | 205 gaim_debug(GAIM_DEBUG_ERROR, "plugins", "%s is unloadable: %s\n", |
| 203 plugin->path, g_module_error()); | 206 plugin->path, error ? error : "Unknown error."); |
| 204 | 207 |
| 205 gaim_plugin_destroy(plugin); | 208 gaim_plugin_destroy(plugin); |
| 206 | 209 |
| 207 return NULL; | 210 return NULL; |
| 208 } | 211 } |
