changeset 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 94ad4d45346a
children d0320de18feb
files src/plugin.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugin.c	Sun Jun 22 16:27:43 2003 +0000
+++ b/src/plugin.c	Sun Jun 22 17:03:03 2003 +0000
@@ -459,13 +459,12 @@
 
 		loader = find_loader_for_plugin(plugin);
 
-		if (loader == NULL)
-			return;
+		if (loader != NULL) {
+			loader_info = GAIM_PLUGIN_LOADER_INFO(loader);
 
-		loader_info = GAIM_PLUGIN_LOADER_INFO(loader);
-
-		if (loader_info->destroy != NULL)
-			loader_info->destroy(plugin);
+			if (loader_info->destroy != NULL)
+				loader_info->destroy(plugin);
+		}
 	}
 
 	if (plugin->path  != NULL) g_free(plugin->path);