changeset 4215:e9e55f0a991c

[gaim-migrate @ 4454] Ari Pollak (sourceo) writes: "This fixes a memory leak in the preferences dialog, since plug->iter gets allocated every time the prefs dialog is opened, but never freed." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 06 Jan 2003 18:37:44 +0000
parents 709de528927e
children c5ca00e0b11e
files src/prefs.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/prefs.c	Mon Jan 06 16:53:49 2003 +0000
+++ b/src/prefs.c	Mon Jan 06 18:37:44 2003 +0000
@@ -82,6 +82,9 @@
 GtkTreeIter *prefs_notebook_add_page(char*, GdkPixbuf*, GtkWidget*, GtkTreeIter*, GtkTreeIter*, int);
 
 void delete_prefs(GtkWidget *asdf, void *gdsa) {
+	GList *l = plugins;
+	struct gaim_plugin *plug;
+	
 	save_prefs();
 	prefs = NULL;
 	tree_v = NULL;
@@ -93,6 +96,14 @@
 	if(sounddialog)
 		gtk_widget_destroy(sounddialog);
 	g_object_unref(G_OBJECT(prefs_away_store));
+	while(l) {
+		plug = l->data;
+		if(plug->iter) {
+			g_free(plug->iter);
+			plug->iter = NULL;
+		}
+		l = l->next;
+	}
 }
 
 GtkWidget *preflabel;