Changeset 3748

Show
Ignore:
Timestamp:
08/31/08 21:12:35
Author:
robtaylor
Message:

Do unrefs in dispose, not finalise for tny-camel-folder and tny-camel-store-account.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3746 r3748  
    190190 
    1911912008-06-20  Jose Dapena Paz  <jdapena@igalia.com> 
    192  
    193         * libtinymail-camel/tny-camel-folder.c: 
    194192        Fix camel operation references 
    195193 
     
    237235        * libtinymail/Makefile.am: 
    238236        Added stream cache implementation files. 
     237 
     2382008-06-12  Rob Taylor  <rob.taylor@codethink.co.uk> 
     239 
     240        * libtinymail-camel/tny-camel-folder.c: 
     241        * libtinymail-camel/tny-camel-store-account.c: 
     242        do unrefs in dispose, not finalise for tny-camel-folder and tny-camel-store-account. 
    239243 
    2402442008-06-10  Sergio Villar Senin  <svillar@igalia.com> 
  • trunk/libtinymail-camel/tny-camel-folder.c

    r3737 r3748  
    60466046 
    60476047static void 
    6048 tny_camel_folder_finalize (GObject *object) 
     6048tny_camel_folder_dispose (GObject *object) 
    60496049{ 
    60506050        TnyCamelFolder *self = (TnyCamelFolder*) object; 
    60516051        TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 
    6052  
    6053  
    6054 #ifdef DEBUG 
    6055         g_print ("Finalizing TnyCamelFolder: %s\n",  
    6056                 priv->folder_name?priv->folder_name:"(cleared)"); 
    6057  
    6058         if (priv->reason_to_live != 0) 
    6059                 g_print ("Finalizing TnyCamelFolder, yet TnyHeader instances " 
    6060                 "are still alive: %d\n", priv->reason_to_live); 
    6061 #endif 
    60626052 
    60636053        if (priv->store) 
     
    61006090        } 
    61016091 
     6092        if (G_LIKELY (priv->remove_strat)) 
     6093                g_object_unref (G_OBJECT (priv->remove_strat)); 
     6094        priv->remove_strat = NULL; 
     6095 
     6096        if (G_LIKELY (priv->receive_strat)) 
     6097                g_object_unref (G_OBJECT (priv->receive_strat)); 
     6098        priv->receive_strat = NULL; 
     6099 
     6100        priv->parent = NULL; 
     6101 
     6102        g_static_rec_mutex_unlock (priv->folder_lock); 
     6103 
     6104        return; 
     6105} 
     6106 
     6107 
     6108static void 
     6109tny_camel_folder_finalize (GObject *object) 
     6110{ 
     6111        TnyCamelFolder *self = (TnyCamelFolder*) object; 
     6112        TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 
     6113 
     6114 
     6115#ifdef DEBUG 
     6116        g_print ("Finalizing TnyCamelFolder: %s\n",  
     6117                priv->folder_name?priv->folder_name:"(cleared)"); 
     6118 
     6119        if (priv->reason_to_live != 0) 
     6120                g_print ("Finalizing TnyCamelFolder, yet TnyHeader instances " 
     6121                "are still alive: %d\n", priv->reason_to_live); 
     6122#endif 
     6123 
     6124        g_static_rec_mutex_lock (priv->folder_lock); 
     6125        priv->dont_fkill = FALSE; 
     6126 
     6127        if (priv->account && TNY_IS_CAMEL_STORE_ACCOUNT (priv->account)) { 
     6128                TnyCamelStoreAccountPriv *apriv = TNY_CAMEL_STORE_ACCOUNT_GET_PRIVATE (priv->account); 
     6129                g_static_rec_mutex_lock (apriv->factory_lock); 
     6130                apriv->managed_folders = g_list_remove (apriv->managed_folders, self); 
     6131                g_static_rec_mutex_unlock (apriv->factory_lock); 
     6132        } 
     6133 
     6134        if (G_LIKELY (priv->folder)) 
     6135        { 
     6136                camel_object_unref (priv->folder); 
     6137                priv->folder = NULL; 
     6138        } 
     6139 
    61026140        if (G_LIKELY (priv->cached_name)) 
    61036141                g_free (priv->cached_name); 
    61046142        priv->cached_name = NULL; 
    6105  
    6106         if (G_LIKELY (priv->remove_strat)) 
    6107                 g_object_unref (G_OBJECT (priv->remove_strat)); 
    6108         priv->remove_strat = NULL; 
    6109  
    6110         if (G_LIKELY (priv->receive_strat)) 
    6111                 g_object_unref (G_OBJECT (priv->receive_strat)); 
    6112         priv->receive_strat = NULL; 
    6113  
    6114         priv->parent = NULL; 
    61156143 
    61166144        g_static_rec_mutex_unlock (priv->folder_lock); 
     
    62066234        parent_class = g_type_class_peek_parent (class); 
    62076235        object_class = (GObjectClass*) class; 
     6236        object_class->dispose = tny_camel_folder_dispose; 
    62086237        object_class->finalize = tny_camel_folder_finalize; 
    62096238 
  • trunk/libtinymail-camel/tny-camel-store-account.c

    r3705 r3748  
    799799} 
    800800 
    801  
    802 static void 
    803 tny_camel_store_account_finalize (GObject *object) 
     801static void 
     802tny_camel_store_account_dispose (GObject *object) 
    804803{ 
    805804        TnyCamelStoreAccount *self = (TnyCamelStoreAccount *)object; 
     
    826825        } 
    827826 
     827        g_object_unref (priv->msg_queue); 
     828 
     829        return; 
     830} 
     831 
     832 
     833static void 
     834tny_camel_store_account_finalize (GObject *object) 
     835{ 
     836        TnyCamelStoreAccount *self = (TnyCamelStoreAccount *)object; 
     837        TnyCamelStoreAccountPriv *priv = TNY_CAMEL_STORE_ACCOUNT_GET_PRIVATE (self); 
     838 
    828839        /* g_static_rec_mutex_free (priv->factory_lock); */ 
    829840        g_free (priv->factory_lock); 
     
    833844        g_free (priv->obs_lock); 
    834845        priv->obs_lock = NULL; 
    835  
    836         g_object_unref (priv->msg_queue); 
    837846 
    838847        (*parent_class->finalize) (object); 
     
    20902099        object_class = (GObjectClass*) class; 
    20912100 
     2101        object_class->dispose = tny_camel_store_account_dispose; 
    20922102        object_class->finalize = tny_camel_store_account_finalize; 
    20932103