Changeset 3313

Show
Ignore:
Timestamp:
01/29/08 17:21:37
Author:
pvanhoof
Message:

2008-01-29 Philip Van Hoof <pvanhoof@gnome.org>

        • Fixed reference counting for all TnyIterator implementations
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3312 r3313  
     12008-01-29  Philip Van Hoof <pvanhoof@gnome.org> 
     2 
     3        * Fixed reference counting for all TnyIterator implementations 
     4 
    152008-01-28  Philip Van Hoof <pvanhoof@gnome.org> 
    26 
  • trunk/libtinymail/tny-simple-list-iterator.c

    r3312 r3313  
    3636        TnySimpleListPriv *lpriv; 
    3737 
    38         self->model = model; 
     38        if (self->model) 
     39                g_object_unref (self->model); 
     40 
     41        self->model = g_object_ref (model); 
    3942 
    4043        lpriv = TNY_SIMPLE_LIST_GET_PRIVATE (self->model); 
     
    7376tny_simple_list_iterator_finalize (GObject *object) 
    7477{ 
     78        TnySimpleListIterator *self = (TnySimpleListIterator *) object; 
     79 
     80        if (self->model) 
     81                g_object_unref (self->model); 
     82 
    7583        (*parent_class->finalize) (object); 
    7684 
  • trunk/libtinymailui-gtk/tny-gtk-account-list-model-iterator.c

    r3312 r3313  
    3232_tny_gtk_account_list_model_iterator_set_model (TnyGtkAccountListModelIterator *self, TnyGtkAccountListModel *model) 
    3333{ 
    34         self->model = model; 
     34        if (self->model) 
     35                g_object_unref (self->model); 
     36 
     37        self->model = g_object_ref (model); 
    3538        self->current = model->first; 
    3639 
     
    6467tny_gtk_account_list_model_iterator_finalize (GObject *object) 
    6568{ 
     69        TnyGtkAccountListModelIterator *self = (TnyGtkAccountListModelIterator *) object; 
     70 
     71        if (self->model) 
     72                g_object_unref (self->model); 
     73 
    6674        (*parent_class->finalize) (object); 
    6775 
  • trunk/libtinymailui-gtk/tny-gtk-attach-list-model-iterator.c

    r3312 r3313  
    3333_tny_gtk_attach_list_model_iterator_set_model (TnyGtkAttachListModelIterator *self, TnyGtkAttachListModel *model) 
    3434{ 
    35         self->model = model; 
     35        if (self->model) 
     36                g_object_unref (self->model); 
     37 
     38        self->model = g_object_ref (model); 
    3639        self->current = model->first; 
    3740 
     
    6568tny_gtk_attach_list_model_iterator_finalize (GObject *object) 
    6669{ 
     70        TnyGtkAttachListModelIterator *self = (TnyGtkAttachListModelIterator *) object; 
     71 
     72        if (self->model) 
     73                g_object_unref (self->model); 
     74 
    6775        (*parent_class->finalize) (object); 
    6876 
  • trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model-iterator.c

    r3312 r3313  
    3232_tny_gtk_folder_store_tree_model_iterator_set_model (TnyGtkFolderStoreTreeModelIterator *self, TnyGtkFolderStoreTreeModel *model) 
    3333{ 
    34         self->model = model; 
     34        if (self->model) 
     35                g_object_unref (self->model); 
     36 
     37        self->model = g_object_ref (model); 
    3538        self->current = model->first; 
    3639 
     
    6467tny_gtk_folder_store_tree_model_iterator_finalize (GObject *object) 
    6568{ 
     69        TnyGtkFolderStoreTreeModelIterator *self = (TnyGtkFolderStoreTreeModelIterator *) object; 
     70 
     71        if (self->model) 
     72                g_object_unref (self->model); 
     73 
    6674        (*parent_class->finalize) (object); 
    6775 
  • trunk/libtinymailui-gtk/tny-gtk-header-list-iterator.c

    r3312 r3313  
    3333_tny_gtk_header_list_iterator_set_model (TnyGtkHeaderListIterator *self, TnyGtkHeaderListModel *model) 
    3434{ 
    35         self->model = model; 
     35        if (self->model) 
     36                g_object_unref (self->model); 
     37 
     38        self->model = g_object_ref (model); 
    3639 
    3740        /* It's not a list_copy, so don't free this list when  
     
    7376tny_gtk_header_list_iterator_finalize (GObject *object) 
    7477{ 
     78        TnyGtkHeaderListIterator *self = (TnyGtkHeaderListIterator *) object; 
     79 
     80        if (self->model) 
     81                g_object_unref (self->model); 
     82 
    7583        (*parent_class->finalize) (object); 
    7684