Changeset 3312

Show
Ignore:
Timestamp:
01/29/08 17:10:35
Author:
pvanhoof
Message:

Revert of something that didn't work out

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3309 r3312  
    1 2008-01-29  Philip Van Hoof <pvanhoof@gnome.org> 
    2  
    3         * Fixed reference counting for all TnyIterator implementations 
    4  
    512008-01-28  Philip Van Hoof <pvanhoof@gnome.org> 
    62 
  • trunk/libtinymail/tny-simple-list-iterator.c

    r3311 r3312  
    3636        TnySimpleListPriv *lpriv; 
    3737 
    38         lpriv = TNY_SIMPLE_LIST_GET_PRIVATE (model); 
    39  
    40         g_mutex_lock (lpriv->iterator_lock); 
    41         if (self->model) 
    42                 g_object_unref (self->model); 
    43         self->model = (TnySimpleList *) g_object_ref (self->model); 
     38        self->model = model; 
     39 
     40        lpriv = TNY_SIMPLE_LIST_GET_PRIVATE (self->model); 
     41 
     42        g_mutex_lock (lpriv->iterator_lock); 
    4443        self->current = lpriv->first; 
    4544        g_mutex_unlock (lpriv->iterator_lock); 
     
    6362tny_simple_list_iterator_instance_init (GTypeInstance *instance, gpointer g_class) 
    6463{ 
    65         TnySimpleListIterator *self = (TnySimpleListIterator *) instance; 
     64        TnySimpleListIterator *self = (TnySimpleListIterator *)instance; 
    6665 
    6766        self->model = NULL; 
     
    7473tny_simple_list_iterator_finalize (GObject *object) 
    7574{ 
    76  
    77         TnySimpleListIterator *self = (TnySimpleListIterator *) object; 
    78  
    79         if (self->model) 
    80                 g_object_unref (self->model); 
    81  
    8275        (*parent_class->finalize) (object); 
    8376 
  • trunk/libtinymailui-gtk/tny-gtk-account-list-model-iterator.c

    r3311 r3312  
    3232_tny_gtk_account_list_model_iterator_set_model (TnyGtkAccountListModelIterator *self, TnyGtkAccountListModel *model) 
    3333{ 
    34         if (self->model) 
    35                 g_object_unref (self->model); 
    36         self->model = (TnyGtkAccountListModel *) g_object_ref (model); 
     34        self->model = model; 
    3735        self->current = model->first; 
    3836 
     
    6664tny_gtk_account_list_model_iterator_finalize (GObject *object) 
    6765{ 
    68         TnyGtkAccountListModelIterator *self = (TnyGtkAccountListModelIterator *) object; 
    69  
    70         if (self->model) 
    71                 g_object_unref (self->model); 
    72  
    7366        (*parent_class->finalize) (object); 
    7467 
     
    197190                return NULL; 
    198191 
    199        g_object_ref (me->model); 
     192               g_object_ref (G_OBJECT (me->model)); 
    200193 
    201194        return TNY_LIST (me->model); 
  • trunk/libtinymailui-gtk/tny-gtk-attach-list-model-iterator.c

    r3311 r3312  
    3333_tny_gtk_attach_list_model_iterator_set_model (TnyGtkAttachListModelIterator *self, TnyGtkAttachListModel *model) 
    3434{ 
    35         if (self->model) 
    36                 g_object_unref (self->model); 
    37         self->model = (TnyGtkAttachListModel *) g_object_ref (model); 
     35        self->model = model; 
    3836        self->current = model->first; 
    3937 
     
    6765tny_gtk_attach_list_model_iterator_finalize (GObject *object) 
    6866{ 
    69         TnyGtkAttachListModelIterator *self = (TnyGtkAttachListModelIterator *) object; 
    70  
    71         if (self->model) 
    72                 g_object_unref (self->model); 
    73  
    7467        (*parent_class->finalize) (object); 
    7568 
  • trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model-iterator.c

    r3309 r3312  
    3232_tny_gtk_folder_store_tree_model_iterator_set_model (TnyGtkFolderStoreTreeModelIterator *self, TnyGtkFolderStoreTreeModel *model) 
    3333{ 
    34         self->model = (TnyGtkFolderStoreTreeModel *) g_object_ref (model)
     34        self->model = model
    3535        self->current = model->first; 
    3636 
     
    6464tny_gtk_folder_store_tree_model_iterator_finalize (GObject *object) 
    6565{ 
    66         TnyGtkFolderStoreTreeModelIterator *self = (TnyGtkFolderStoreTreeModelIterator *) object; 
    67  
    68         if (self->model) 
    69                 g_object_unref (self); 
    70  
    7166        (*parent_class->finalize) (object); 
    7267 
     
    179174 
    180175        if (ptr) 
    181                 g_object_ref (ptr); 
     176                g_object_ref (G_OBJECT(ptr)); 
    182177         
    183178        return G_OBJECT(ptr); 
  • trunk/libtinymailui-gtk/tny-gtk-header-list-iterator.c

    r3311 r3312  
    3333_tny_gtk_header_list_iterator_set_model (TnyGtkHeaderListIterator *self, TnyGtkHeaderListModel *model) 
    3434{ 
    35  
    36         if (self->model) 
    37                 g_object_unref (self->model); 
    38         self->model = (TnyGtkHeaderListModel *) g_object_ref (model); 
     35        self->model = model; 
    3936 
    4037        /* It's not a list_copy, so don't free this list when  
     
    7673tny_gtk_header_list_iterator_finalize (GObject *object) 
    7774{ 
    78         TnyGtkHeaderListIterator *self = (TnyGtkHeaderListIterator *) object; 
    79  
    80         if (self->model) 
    81                 g_object_unref (self->model); 
    82  
    8375        (*parent_class->finalize) (object); 
    8476