diff src/notify.c @ 14035:8bda65b88e49

[gaim-migrate @ 16638] A bunch of small changes. Mostly remove "if not null" checks before calling g_free, g_list_free, g_slist_free and g_strdup. Also use g_list_foreach() to call g_free to free strings in an array. And some whitespace changes here and there. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 05 Aug 2006 08:27:39 +0000
parents fccb5cfa33b9
children
line wrap: on
line diff
--- a/src/notify.c	Sat Aug 05 05:42:28 2006 +0000
+++ b/src/notify.c	Sat Aug 05 08:27:39 2006 +0000
@@ -60,9 +60,9 @@
 
 		if (info->ui_handle != NULL) {
 			handles = g_list_append(handles, info);
-			
+
 			return info->ui_handle;
-			
+
 		} else {
 			if (info->cb != NULL)
 				info->cb(info->cb_user_data);
@@ -111,7 +111,7 @@
 			g_free(info);
 
 			return NULL;
-		}		
+		}
 	} else {
 		if (cb != NULL)
 			cb(user_data);
@@ -197,15 +197,15 @@
 
 		if (info->ui_handle != NULL) {
 			handles = g_list_append(handles, info);
-			
+
 			return info->ui_handle;
-			
+
 		} else {
 			if (info->cb != NULL)
 				info->cb(info->cb_user_data);
-			
+
 			g_free(info);
-			
+
 			return NULL;
 		}
 
@@ -272,23 +272,18 @@
 		g_free(button->label);
 		g_free(button);
 	}
-	results->buttons = NULL;
 
 	for (l = results->rows; l; l = g_list_delete_link(l, l)) {
 		GList *row = l->data;
-		for (; row; row = g_list_delete_link(row, row)) {
-			gchar *str = row->data;
-			g_free(str);
-		}
+		g_list_foreach(row, (GFunc)g_free, NULL);
+		g_list_free(row);
 	}
-	results->rows = NULL;
 
 	for (l = results->columns; l; l = g_list_delete_link(l, l)) {
 		GaimNotifySearchColumn *column = l->data;
 		g_free(column->title);
 		g_free(column);
 	}
-	results->columns = NULL;
 
 	g_free(results);
 }
@@ -487,7 +482,7 @@
 
 		if (info->ui_handle != NULL) {
 			handles = g_list_append(handles, info);
-			
+
 			return info->ui_handle;
 
 		} else {