comparison src/plugin.c @ 5941:a3e60ff95b7d

[gaim-migrate @ 6381] Fixed a rather good-sized memory leak in plugins. Thanks to faceprint for pointing it out. I thought it was memprof being confused, but it turns out that in the gaim_plugin_destroy() function, we return early if a loader plugin for a non-native plugin cannot be found. That is no good. The check was there to prevent the loader plugin's destroy_plugin() from being called, but the proper fix was just to wrap that in an if statement. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 22 Jun 2003 17:03:03 +0000
parents 059d95c67cda
children 90d0849abd3c
comparison
equal deleted inserted replaced
5940:94ad4d45346a 5941:a3e60ff95b7d
457 GaimPlugin *loader; 457 GaimPlugin *loader;
458 GaimPluginLoaderInfo *loader_info; 458 GaimPluginLoaderInfo *loader_info;
459 459
460 loader = find_loader_for_plugin(plugin); 460 loader = find_loader_for_plugin(plugin);
461 461
462 if (loader == NULL) 462 if (loader != NULL) {
463 return; 463 loader_info = GAIM_PLUGIN_LOADER_INFO(loader);
464 464
465 loader_info = GAIM_PLUGIN_LOADER_INFO(loader); 465 if (loader_info->destroy != NULL)
466 466 loader_info->destroy(plugin);
467 if (loader_info->destroy != NULL) 467 }
468 loader_info->destroy(plugin);
469 } 468 }
470 469
471 if (plugin->path != NULL) g_free(plugin->path); 470 if (plugin->path != NULL) g_free(plugin->path);
472 if (plugin->error != NULL) g_free(plugin->error); 471 if (plugin->error != NULL) g_free(plugin->error);
473 472