changeset 28245:32a707746454

Clean up various file-scoped globals at uninit. These are all from a user's valgrind log in #pidgin a week or so ago. I think only the proxy and pounce are legitimate leaks.
author Paul Aurich <paul@darkrain42.org>
date Thu, 13 Aug 2009 03:26:27 +0000
parents 9621d984f6ca
children c93ed4d7cabe
files libpurple/pounce.c libpurple/prefs.c libpurple/proxy.c libpurple/savedstatuses.c
diffstat 4 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/pounce.c	Thu Aug 13 01:17:04 2009 +0000
+++ b/libpurple/pounce.c	Thu Aug 13 03:26:27 2009 +0000
@@ -1157,4 +1157,7 @@
 	}
 
 	purple_signals_disconnect_by_handle(purple_pounces_get_handle());
+
+	g_hash_table_destroy(pounce_handlers);
+	pounce_handlers = NULL;
 }
--- a/libpurple/prefs.c	Thu Aug 13 01:17:04 2009 +0000
+++ b/libpurple/prefs.c	Thu Aug 13 03:26:27 2009 +0000
@@ -1450,6 +1450,8 @@
 		sync_prefs();
 	}
 
+	purple_prefs_disconnect_by_handle(purple_prefs_get_handle());
+
 	prefs_loaded = FALSE;
 	purple_prefs_destroy();
 	g_hash_table_destroy(prefs_hash);
--- a/libpurple/proxy.c	Thu Aug 13 01:17:04 2009 +0000
+++ b/libpurple/proxy.c	Thu Aug 13 03:26:27 2009 +0000
@@ -2531,4 +2531,9 @@
 		purple_proxy_connect_data_disconnect(handles->data, NULL);
 		purple_proxy_connect_data_destroy(handles->data);
 	}
+
+	purple_prefs_disconnect_by_handle(purple_proxy_get_handle());
+
+	purple_proxy_info_destroy(global_proxy_info);
+	global_proxy_info = NULL;
 }
--- a/libpurple/savedstatuses.c	Thu Aug 13 01:17:04 2009 +0000
+++ b/libpurple/savedstatuses.c	Thu Aug 13 03:26:27 2009 +0000
@@ -1235,6 +1235,8 @@
 void
 purple_savedstatuses_uninit(void)
 {
+	gpointer handle = purple_savedstatuses_get_handle();
+
 	remove_old_transient_statuses();
 
 	if (save_timer != 0)
@@ -1253,6 +1255,7 @@
 	g_hash_table_destroy(creation_times);
 	creation_times = NULL;
 
-	purple_signals_unregister_by_instance(purple_savedstatuses_get_handle());
+	purple_signals_unregister_by_instance(handle);
+	purple_signals_disconnect_by_handle(handle);
 }