pidgin: aff70668: Various libpurple uninit memory cleanups...

elb at pidgin.im elb at pidgin.im
Thu Apr 9 14:10:45 EDT 2009


-----------------------------------------------------------------
Revision: aff70668336849d4b1513fd8577f4d2a276d2520
Ancestor: 45fc1a7bfe7a02fda891328b7d2fb040a07f0f1d
Author: hebnern at gmail.com
Date: 2009-04-09T17:38:45
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/aff70668336849d4b1513fd8577f4d2a276d2520

Modified files:
        libpurple/account.c libpurple/buddyicon.c libpurple/plugin.c

ChangeLog: 

Various libpurple uninit memory cleanups.

Thanks to Nick Hebner

References #8683

-------------- next part --------------
============================================================
--- libpurple/account.c	7f67a5a8076d88496dd0f19fcc58aa185b8425c3
+++ libpurple/account.c	d7d0887168b48bcc3eba8706583c05ec55e7136f
@@ -2787,6 +2787,7 @@ purple_accounts_uninit(void)
 void
 purple_accounts_uninit(void)
 {
+	GList* account;
 	gpointer handle = purple_accounts_get_handle();
 	if (save_timer != 0)
 	{
@@ -2797,4 +2798,10 @@ purple_accounts_uninit(void)
 
 	purple_signals_disconnect_by_handle(handle);
 	purple_signals_unregister_by_instance(handle);
+
+	account = purple_accounts_get_all();
+	while (account) {
+		purple_account_destroy(account->data);
+		account = g_list_delete_link(account, account);
+	}
 }
============================================================
--- libpurple/buddyicon.c	027c85d8ef0bd332f0fe4b8c44afa45c7aebeb41
+++ libpurple/buddyicon.c	f0509debca62b7316fff43aab3b3ae0fdec06a06
@@ -1299,6 +1299,7 @@ purple_buddy_icons_uninit()
 	g_hash_table_destroy(icon_file_cache);
 	g_hash_table_destroy(pointer_icon_cache);
 	g_free(old_icons_dir);
+	g_free(cache_dir);
 }
 
 void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int *height)
============================================================
--- libpurple/plugin.c	b2e9059783202846c8b94cb99587be8701d87d73
+++ libpurple/plugin.c	d0943369db0f9507c5c582df884a6acbd5f0462c
@@ -1201,6 +1201,11 @@ purple_plugins_uninit(void)
 
 	purple_signals_disconnect_by_handle(handle);
 	purple_signals_unregister_by_instance(handle);
+
+	while (search_paths) {
+		g_free(search_paths->data);
+		search_paths = g_list_delete_link(search_paths, search_paths);
+	}
 }
 
 /**************************************************************************


More information about the Commits mailing list