comparison 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
comparison
equal deleted inserted replaced
14034:0839a7b71325 14035:8bda65b88e49
58 info->cb = cb; 58 info->cb = cb;
59 info->cb_user_data = user_data; 59 info->cb_user_data = user_data;
60 60
61 if (info->ui_handle != NULL) { 61 if (info->ui_handle != NULL) {
62 handles = g_list_append(handles, info); 62 handles = g_list_append(handles, info);
63 63
64 return info->ui_handle; 64 return info->ui_handle;
65 65
66 } else { 66 } else {
67 if (info->cb != NULL) 67 if (info->cb != NULL)
68 info->cb(info->cb_user_data); 68 info->cb(info->cb_user_data);
69 69
70 g_free(info); 70 g_free(info);
109 info->cb(info->cb_user_data); 109 info->cb(info->cb_user_data);
110 110
111 g_free(info); 111 g_free(info);
112 112
113 return NULL; 113 return NULL;
114 } 114 }
115 } else { 115 } else {
116 if (cb != NULL) 116 if (cb != NULL)
117 cb(user_data); 117 cb(user_data);
118 } 118 }
119 119
195 info->cb = cb; 195 info->cb = cb;
196 info->cb_user_data = user_data; 196 info->cb_user_data = user_data;
197 197
198 if (info->ui_handle != NULL) { 198 if (info->ui_handle != NULL) {
199 handles = g_list_append(handles, info); 199 handles = g_list_append(handles, info);
200 200
201 return info->ui_handle; 201 return info->ui_handle;
202 202
203 } else { 203 } else {
204 if (info->cb != NULL) 204 if (info->cb != NULL)
205 info->cb(info->cb_user_data); 205 info->cb(info->cb_user_data);
206 206
207 g_free(info); 207 g_free(info);
208 208
209 return NULL; 209 return NULL;
210 } 210 }
211 211
212 } else { 212 } else {
213 if (cb != NULL) 213 if (cb != NULL)
270 for (l = results->buttons; l; l = g_list_delete_link(l, l)) { 270 for (l = results->buttons; l; l = g_list_delete_link(l, l)) {
271 GaimNotifySearchButton *button = l->data; 271 GaimNotifySearchButton *button = l->data;
272 g_free(button->label); 272 g_free(button->label);
273 g_free(button); 273 g_free(button);
274 } 274 }
275 results->buttons = NULL;
276 275
277 for (l = results->rows; l; l = g_list_delete_link(l, l)) { 276 for (l = results->rows; l; l = g_list_delete_link(l, l)) {
278 GList *row = l->data; 277 GList *row = l->data;
279 for (; row; row = g_list_delete_link(row, row)) { 278 g_list_foreach(row, (GFunc)g_free, NULL);
280 gchar *str = row->data; 279 g_list_free(row);
281 g_free(str); 280 }
282 }
283 }
284 results->rows = NULL;
285 281
286 for (l = results->columns; l; l = g_list_delete_link(l, l)) { 282 for (l = results->columns; l; l = g_list_delete_link(l, l)) {
287 GaimNotifySearchColumn *column = l->data; 283 GaimNotifySearchColumn *column = l->data;
288 g_free(column->title); 284 g_free(column->title);
289 g_free(column); 285 g_free(column);
290 } 286 }
291 results->columns = NULL;
292 287
293 g_free(results); 288 g_free(results);
294 } 289 }
295 290
296 void 291 void
485 info->handle = handle; 480 info->handle = handle;
486 info->ui_handle = ops->notify_uri(uri); 481 info->ui_handle = ops->notify_uri(uri);
487 482
488 if (info->ui_handle != NULL) { 483 if (info->ui_handle != NULL) {
489 handles = g_list_append(handles, info); 484 handles = g_list_append(handles, info);
490 485
491 return info->ui_handle; 486 return info->ui_handle;
492 487
493 } else { 488 } else {
494 g_free(info); 489 g_free(info);
495 490