From cbca7060e3dc8b122d66b238424d9cb6890cee2d Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Mon, 25 Jun 2007 15:44:03 +0000 Subject: [PATCH] * Removed an invalid g_object_unref * Added some gdk_threads_enter/leave in the mail operations pmo-trunk-r2407 --- src/modest-mail-operation.c | 15 +++++++++++++-- src/modest-ui-actions.c | 3 +-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index c3fa967..5f636da 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -1091,10 +1091,14 @@ update_account_thread (gpointer thr_user_data) be still alive */ g_idle_add (notify_update_account_queue, g_object_ref (info->mail_op)); - if (info->callback) + if (info->callback) { + /* This thread is not in the main lock */ + gdk_threads_enter (); info->callback (info->mail_op, (new_headers) ? new_headers->len : 0, info->user_data); + gdk_threads_leave (); + } /* Frees */ g_object_unref (query); @@ -1563,7 +1567,11 @@ get_msg_cb (TnyFolder *folder, /* If user defined callback function was defined, call it */ if (helper->user_callback) { + /* This callback is called into an iddle by tinymail, + and idles are not in the main lock */ + gdk_threads_enter (); helper->user_callback (self, helper->header, msg, helper->user_data); + gdk_threads_leave (); } out: @@ -1636,8 +1644,11 @@ notify_get_msgs_full (gpointer data) info = (NotifyGetMsgsInfo *) data; - /* Call the user callback */ + /* Call the user callback. Idles are not in the main lock, so + lock it */ + gdk_threads_enter (); info->user_callback (info->mail_op, info->header, info->msg, info->user_data); + gdk_threads_leave (); g_slice_free (NotifyGetMsgsInfo, info); diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index ada3f99..0fd4141 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -665,7 +665,6 @@ cleanup: g_object_unref (parent_win); g_object_unref (msg); g_object_unref (folder); - g_object_unref (header); } /* @@ -3075,7 +3074,7 @@ modest_ui_actions_on_settings (GtkAction *action, dialog = modest_platform_get_global_settings_dialog (); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (win)); - gtk_widget_show (dialog); + gtk_widget_show_all (dialog); gtk_dialog_run (GTK_DIALOG (dialog)); -- 1.7.9.5