pidgin: abdecd59: Clean up various file-scoped globals at ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed Aug 12 23:34:48 EDT 2009


-----------------------------------------------------------------
Revision: abdecd59fbf18da0d4f391df390910b525356ffb
Ancestor: 8fef7485f0da115135b70f8f9ab709685878b4d7
Author: darkrain42 at pidgin.im
Date: 2009-08-13T03:26:27
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/abdecd59fbf18da0d4f391df390910b525356ffb

Modified files:
        libpurple/pounce.c libpurple/prefs.c libpurple/proxy.c
        libpurple/savedstatuses.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/pounce.c	41ff91aae25bcbc3f573eba3949709cdd29493dc
+++ libpurple/pounce.c	d82d02a6e5157e83bf37b24527ff8cfbd6dfc353
@@ -1157,4 +1157,7 @@ purple_pounces_uninit()
 	}
 
 	purple_signals_disconnect_by_handle(purple_pounces_get_handle());
+
+	g_hash_table_destroy(pounce_handlers);
+	pounce_handlers = NULL;
 }
============================================================
--- libpurple/prefs.c	d98de92602ae1b38250bac8c2fd38f76024c91f5
+++ libpurple/prefs.c	0852297ed511a8cd39bfc70e219007ad2ff37ee2
@@ -1450,6 +1450,8 @@ purple_prefs_uninit()
 		sync_prefs();
 	}
 
+	purple_prefs_disconnect_by_handle(purple_prefs_get_handle());
+
 	prefs_loaded = FALSE;
 	purple_prefs_destroy();
 	g_hash_table_destroy(prefs_hash);
============================================================
--- libpurple/proxy.c	63905d371dd750c01feb2dfefbf431128bbfa251
+++ libpurple/proxy.c	38f80798fa823b1b15b559316f968e4d88f441ee
@@ -2531,4 +2531,9 @@ purple_proxy_uninit(void)
 		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;
 }
============================================================
--- libpurple/savedstatuses.c	fa593cedc130ed4869721e7daaf5fb7af1d0752c
+++ libpurple/savedstatuses.c	7572a1ede9dc1eb57c9120402891644145265bfb
@@ -1235,6 +1235,8 @@ purple_savedstatuses_uninit(void)
 void
 purple_savedstatuses_uninit(void)
 {
+	gpointer handle = purple_savedstatuses_get_handle();
+
 	remove_old_transient_statuses();
 
 	if (save_timer != 0)
@@ -1253,6 +1255,7 @@ purple_savedstatuses_uninit(void)
 	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);
 }
 


More information about the Commits mailing list