| 43 static gint |
43 static gint |
| 44 delete_win_cb(GtkWidget *w, GdkEvent *event, GevoAddBuddyDialog *dialog) |
44 delete_win_cb(GtkWidget *w, GdkEvent *event, GevoAddBuddyDialog *dialog) |
| 45 { |
45 { |
| 46 gtk_widget_destroy(dialog->win); |
46 gtk_widget_destroy(dialog->win); |
| 47 |
47 |
| 48 if (dialog->contacts != NULL) |
48 g_list_free_full(dialog->contacts, g_object_unref); |
| 49 { |
|
| 50 g_list_foreach(dialog->contacts, (GFunc)g_object_unref, NULL); |
|
| 51 g_list_free(dialog->contacts); |
|
| 52 } |
|
| 53 |
49 |
| 54 if (dialog->book != NULL) |
50 if (dialog->book != NULL) |
| 55 g_object_unref(dialog->book); |
51 g_object_unref(dialog->book); |
| 56 |
52 |
| 57 gevo_addrbooks_model_unref(dialog->addrbooks); |
53 gevo_addrbooks_model_unref(dialog->addrbooks); |
| 243 dialog->book = NULL; |
238 dialog->book = NULL; |
| 244 } |
239 } |
| 245 |
240 |
| 246 if (dialog->contacts != NULL) |
241 if (dialog->contacts != NULL) |
| 247 { |
242 { |
| 248 g_list_foreach(dialog->contacts, (GFunc)g_object_unref, NULL); |
243 g_list_free_full(dialog->contacts, g_object_unref); |
| 249 g_list_free(dialog->contacts); |
|
| 250 dialog->contacts = NULL; |
244 dialog->contacts = NULL; |
| 251 } |
245 } |
| 252 |
246 |
| 253 gtk_list_store_clear(dialog->model); |
247 gtk_list_store_clear(dialog->model); |
| 254 |
248 |