diff libpurple/notify.c @ 19114:6de2e9ba0930

merge of '2970edca111b3535ae0703e3c866ad1c3b87df94' and 'a2b508e8680ac3f20965226a5dd83f7e2a3b15bb'
author Eric Polino <aluink@pidgin.im>
date Sun, 24 Jun 2007 02:56:09 +0000
parents 59aec2d6ec43
children cb91bb07eeff
line wrap: on
line diff
--- a/libpurple/notify.c	Sun Jun 24 02:55:54 2007 +0000
+++ b/libpurple/notify.c	Sun Jun 24 02:56:09 2007 +0000
@@ -530,7 +530,7 @@
 	g_free(user_info);
 }
 
-const GList *
+GList *
 purple_notify_user_info_get_entries(PurpleNotifyUserInfo *user_info)
 {
 	g_return_val_if_fail(user_info != NULL, NULL);
@@ -749,18 +749,16 @@
 void
 purple_notify_close_with_handle(void *handle)
 {
-	GList *l, *l_next;
+	GList *l, *prev = NULL;
 	PurpleNotifyUiOps *ops;
 
 	g_return_if_fail(handle != NULL);
 
 	ops = purple_notify_get_ui_ops();
 
-	for (l = handles; l != NULL; l = l_next) {
+	for (l = handles; l != NULL; l = prev ? prev->next : handles) {
 		PurpleNotifyInfo *info = l->data;
 
-		l_next = l->next;
-
 		if (info->handle == handle) {
 			handles = g_list_remove(handles, info);
 
@@ -771,7 +769,8 @@
 				info->cb(info->cb_user_data);
 
 			g_free(info);
-		}
+		} else
+			prev = l;
 	}
 }