Changeset 2959

Show
Ignore:
Timestamp:
11/16/07 00:04:43
Author:
pvanhoof
Message:

2007-11-16 Philip Van Hoof <pvanhoof@gnome.org>

disconnected when the instance finalised

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r2956 r2959  
     12007-11-16  Philip Van Hoof  <pvanhoof@gnome.org> 
     2 
     3        * Bugfix in TnyGtkFolderStoreTreeModel: the signals where not being 
     4        disconnected when the instance finalised. 
     5 
    162007-11-15  Sergio Villar Senin  <svillar@igalia.com> 
    27 
  • trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model.c

    r2955 r2959  
    306306        TnyList *list = NULL; 
    307307 
     308        if (!self || !TNY_IS_GTK_FOLDER_STORE_TREE_MODEL (self)) 
     309                return; 
     310 
    308311        /* This callback handler deals with connection status changes. In case 
    309312         * we got connected, we can expect that, at least sometimes, new folders 
     
    375378        if (tny_account_is_ready (info->account)) 
    376379        { 
    377                 g_signal_connect (info->account, "connection-status-changed", 
     380                info->self->signal1 = (gint) g_signal_connect (info->account, "connection-status-changed", 
    378381                        G_CALLBACK (tny_gtk_folder_store_tree_model_on_constatus_changed), info->self); 
    379382 
    380                 g_signal_connect (info->account, "changed", 
     383                info->self->signal1 = (gint) g_signal_connect (info->account, "changed", 
    381384                        G_CALLBACK (tny_gtk_folder_store_tree_model_on_changed), info->self); 
    382385 
     
    498501        GList *copy = me->fol_obs; 
    499502 
     503        if (me->signal1 != -1) 
     504                g_signal_handler_disconnect (me, me->signal1); 
     505 
     506        if (me->signal2 != -1) 
     507                g_signal_handler_disconnect (me, me->signal2); 
     508 
    500509        while (copy) { 
    501510                remove_folder_observer_weak (me, (TnyFolder *) copy->data, TRUE); 
     
    557566        static GType types[] = { G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INT, G_TYPE_OBJECT }; 
    558567 
     568        me->signal1 = -1; 
     569        me->signal2 = -1; 
    559570        me->fol_obs = NULL; 
    560571        me->store_obs = NULL; 
  • trunk/libtinymailui-gtk/tny-gtk-folder-store-tree-model.h

    r2944 r2959  
    6262        TnyFolderStoreQuery *query; 
    6363        gboolean first_needs_unref; 
     64        gint signal1, signal2; 
    6465}; 
    6566