Changeset 2943
- Timestamp:
- 11/13/07 21:58:02
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-account-list-model.c (modified) (6 diffs)
- trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r2941 r2943 3 3 * Weak references for TnyHeader instances in TnyCamelMsgHeader 4 4 * Reference counting mistakes in TnyGtkFolderStoreTreeModel 5 * Reference counting mistakes in TnyGtkAccountListModel 5 6 6 7 2007-11-12 Vivek Sekar <viveksekar@gmail.com> trunk/libtinymailui-gtk/tny-gtk-account-list-model.c
r2825 r2943 58 58 } 59 59 60 static void61 destroy_accs (gpointer item, gpointer user_data)62 {63 if (item && G_IS_OBJECT (item))64 g_object_unref (G_OBJECT (item));65 return;66 }67 60 68 61 static void … … 73 66 g_mutex_lock (me->iterator_lock); 74 67 if (me->first) 75 { 76 g_list_foreach (me->first, destroy_accs, NULL); 77 g_list_free (me->first); me->first = NULL; 78 } 68 g_list_free (me->first); 69 me->first = NULL; 79 70 g_mutex_unlock (me->iterator_lock); 80 71 … … 134 125 135 126 g_mutex_lock (me->iterator_lock); 136 g_object_ref (G_OBJECT (item));137 me->first = g_list_prepend (me->first, item);138 127 gtk_list_store_prepend (store, &iter); 139 128 gtk_list_store_set (store, &iter, 140 129 TNY_GTK_ACCOUNT_LIST_MODEL_NAME_COLUMN, tny_account_get_name (account), 141 130 TNY_GTK_ACCOUNT_LIST_MODEL_INSTANCE_COLUMN, account, -1); 131 me->first = g_list_prepend (me->first, item); 142 132 g_mutex_unlock (me->iterator_lock); 143 133 } … … 152 142 153 143 g_mutex_lock (me->iterator_lock); 154 g_object_ref (G_OBJECT (item));155 me->first = g_list_append (me->first, item);156 144 gtk_list_store_append (store, &iter); 157 145 gtk_list_store_set (store, &iter, 158 146 TNY_GTK_ACCOUNT_LIST_MODEL_NAME_COLUMN, tny_account_get_name (account), 159 147 TNY_GTK_ACCOUNT_LIST_MODEL_INSTANCE_COLUMN, account, -1); 148 me->first = g_list_append (me->first, item); 160 149 g_mutex_unlock (me->iterator_lock); 161 150 } … … 187 176 188 177 g_mutex_lock (me->iterator_lock); 189 178 190 179 me->first = g_list_remove (me->first, (gconstpointer)item); 191 180 … … 202 191 { 203 192 gtk_list_store_remove (GTK_LIST_STORE (me), &iter); 204 g_object_unref ( G_OBJECT (item));193 g_object_unref (citem); 205 194 break; 206 195 } 207 g_object_unref ( G_OBJECT (citem));196 g_object_unref (citem); 208 197 } 209 198 trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c
r2941 r2943 492 492 } 493 493 494 static void495 destroy_folder_stores (gpointer item, gpointer user_data)496 {497 if (item && G_IS_OBJECT (item))498 g_object_unref (G_OBJECT (item));499 return;500 }501 494 502 495 … … 528 521 g_mutex_lock (me->iterator_lock); 529 522 if (me->first) 530 { 531 g_list_foreach (me->first, destroy_folder_stores, NULL); 532 g_list_free (me->first); me->first = NULL; 533 } 523 g_list_free (me->first); 524 me->first = NULL; 534 525 g_mutex_unlock (me->iterator_lock); 535 526 … … 603 594 604 595 /* Prepend something to the list */ 605 g_object_ref (item);606 596 me->first = g_list_prepend (me->first, item); 607 597 … … 621 611 622 612 /* Prepend something to the list */ 623 g_object_ref (item);624 613 me->first = g_list_prepend (me->first, item); 625 614 … … 646 635 647 636 /* Append something to the list */ 648 g_object_ref (item);649 637 me->first = g_list_append (me->first, item); 650 638 … … 663 651 664 652 /* Append something to the list */ 665 g_object_ref (item);666 653 me->first = g_list_append (me->first, item); 667 654
