changeset 22725:98fd7c994d68

Avoiding emitting the "savedstatus-changed" signal twice when the savedstatus is set to idleaway. Also, NULL freed memory so that if plugins try to do stuff they shouldn't do, we don't access it.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 25 Apr 2008 15:37:21 +0000
parents 17cd33c5b5ef
children 1cd99421c696
files libpurple/savedstatuses.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/savedstatuses.c	Fri Apr 25 05:53:48 2008 +0000
+++ b/libpurple/savedstatuses.c	Fri Apr 25 15:37:21 2008 +0000
@@ -1128,10 +1128,12 @@
 
 	g_list_free(accounts);
 
-	purple_savedstatus_set_idleaway(FALSE);
-
-	purple_signal_emit(purple_savedstatuses_get_handle(), "savedstatus-changed",
-					 saved_status, old);
+	if (purple_savedstatus_is_idleaway()) {
+		purple_savedstatus_set_idleaway(FALSE);
+	} else {
+		purple_signal_emit(purple_savedstatuses_get_handle(), "savedstatus-changed",
+					 	   saved_status, old);
+	}
 }
 
 void
@@ -1250,6 +1252,7 @@
 	}
 
 	g_hash_table_destroy(creation_times);
+	creation_times = NULL;
 
 	purple_signals_unregister_by_instance(purple_savedstatuses_get_handle());
 }