changeset 22830:f15d9ded0c45

Clean up loggers when quitting (or unloading the logreader plugin).
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 03 May 2008 19:45:15 +0000
parents 3c98c25b076b
children 0b11895cc564
files libpurple/log.c libpurple/plugins/log_reader.c
diffstat 2 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/log.c	Sat May 03 19:22:02 2008 +0000
+++ b/libpurple/log.c	Sat May 03 19:45:15 2008 +0000
@@ -667,6 +667,18 @@
 purple_log_uninit(void)
 {
 	purple_signals_unregister_by_instance(purple_log_get_handle());
+
+	purple_log_logger_remove(html_logger);
+	purple_log_logger_free(html_logger);
+	html_logger = NULL;
+
+	purple_log_logger_remove(txt_logger);
+	purple_log_logger_free(txt_logger);
+	txt_logger = NULL;
+
+	purple_log_logger_remove(old_logger);
+	purple_log_logger_free(old_logger);
+	old_logger = NULL;
 }
 
 /****************************************************************************
--- a/libpurple/plugins/log_reader.c	Sat May 03 19:22:02 2008 +0000
+++ b/libpurple/plugins/log_reader.c	Sat May 03 19:45:15 2008 +0000
@@ -2789,14 +2789,34 @@
 	g_return_val_if_fail(plugin != NULL, FALSE);
 
 	purple_log_logger_remove(adium_logger);
+	purple_log_logger_free(adium_logger);
+	adium_logger = NULL;
+
 #if 0
 	purple_log_logger_remove(fire_logger);
+	purple_log_logger_free(fire_logger);
+	fire_logger = NULL;
+
 	purple_log_logger_remove(messenger_plus_logger);
+	purple_log_logger_free(messenger_plus_logger);
+	messenger_plus_logger = NULL;
 #endif
+
 	purple_log_logger_remove(msn_logger);
+	purple_log_logger_free(msn_logger);
+	msn_logger = NULL;
+
 	purple_log_logger_remove(trillian_logger);
+	purple_log_logger_free(trillian_logger);
+	trillian_logger = NULL;
+
 	purple_log_logger_remove(qip_logger);
+	purple_log_logger_free(qip_logger);
+	qip_logger = NULL;
+
 	purple_log_logger_remove(amsn_logger);
+	purple_log_logger_free(amsn_logger);
+	amsn_logger = NULL;
 
 	return TRUE;
 }