X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-account-view.c;h=9c4f9e6d10834f02ed9fa8ad79193f0373198d52;hp=eef4aa5d85a4552e93961259fe4b6b0ddb7aab59;hb=b693e89d362b4a4efbb780762cdbc97d220acdce;hpb=fc9e22262b3ec375140b1cdf954b4660f03b9e36 diff --git a/src/widgets/modest-account-view.c b/src/widgets/modest-account-view.c index eef4aa5..9c4f9e6 100644 --- a/src/widgets/modest-account-view.c +++ b/src/widgets/modest-account-view.c @@ -123,6 +123,8 @@ modest_account_view_init (ModestAccountView *obj) priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE(obj); priv->account_mgr = NULL; + priv->sig1 = 0; + priv->sig2 = 0; } static void @@ -133,6 +135,12 @@ modest_account_view_finalize (GObject *obj) priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE(obj); if (priv->account_mgr) { + if (priv->sig1) + g_signal_handler_disconnect (priv->account_mgr, priv->sig1); + + if (priv->sig2) + g_signal_handler_disconnect (priv->account_mgr, priv->sig2); + g_object_unref (G_OBJECT(priv->account_mgr)); priv->account_mgr = NULL; } @@ -152,6 +160,11 @@ update_account_view (ModestAccountMgr *account_mgr, ModestAccountView *view) gtk_list_store_clear (model); cursor = account_names = modest_account_mgr_account_names (account_mgr); + + if(account_names == NULL) + { + printf ("debug: modest_account_mgr_account_names() returned NULL\n"); + } while (cursor) { gchar *account_name; @@ -315,9 +328,9 @@ init_view (ModestAccountView *self) gtk_tree_view_column_set_cell_data_func(column, text_renderer, bold_if_default_cell_data, NULL, NULL); - g_signal_connect (G_OBJECT(priv->account_mgr),"account_removed", + priv->sig1 = g_signal_connect (G_OBJECT(priv->account_mgr),"account_removed", G_CALLBACK(on_account_removed), self); - g_signal_connect (G_OBJECT(priv->account_mgr), "account_changed", + priv->sig2 = g_signal_connect (G_OBJECT(priv->account_mgr), "account_changed", G_CALLBACK(on_account_changed), self); } @@ -334,13 +347,13 @@ modest_account_view_new (ModestAccountMgr *account_mgr) obj = g_object_new(MODEST_TYPE_ACCOUNT_VIEW, NULL); priv = MODEST_ACCOUNT_VIEW_GET_PRIVATE(obj); - g_object_ref (G_OBJECT(account_mgr)); + g_object_ref (G_OBJECT (account_mgr)); priv->account_mgr = account_mgr; init_view (MODEST_ACCOUNT_VIEW (obj)); - update_account_view (account_mgr, MODEST_ACCOUNT_VIEW(obj)); + update_account_view (account_mgr, MODEST_ACCOUNT_VIEW (obj)); - return MODEST_ACCOUNT_VIEW(obj); + return MODEST_ACCOUNT_VIEW (obj); } gchar *