* Removed an invalid g_object_unref
authorSergio Villar Senin <svillar@igalia.com>
Mon, 25 Jun 2007 15:44:03 +0000 (15:44 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Mon, 25 Jun 2007 15:44:03 +0000 (15:44 +0000)
* Added some gdk_threads_enter/leave in the mail operations

pmo-trunk-r2407

src/modest-mail-operation.c
src/modest-ui-actions.c

index c3fa967..5f636da 100644 (file)
@@ -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));
 
           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);
                info->callback (info->mail_op, 
                                (new_headers) ? new_headers->len : 0, 
                                info->user_data);
+               gdk_threads_leave ();
+       }
        
        /* Frees */
        g_object_unref (query);
        
        /* 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) {
 
        /* 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);
                helper->user_callback (self, helper->header, msg, helper->user_data);
+               gdk_threads_leave ();
        }
 
  out:
        }
 
  out:
@@ -1636,8 +1644,11 @@ notify_get_msgs_full (gpointer data)
 
        info = (NotifyGetMsgsInfo *) 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);
        info->user_callback (info->mail_op, info->header, info->msg, info->user_data);
+       gdk_threads_leave ();
 
        g_slice_free (NotifyGetMsgsInfo, info);
 
 
        g_slice_free (NotifyGetMsgsInfo, info);
 
index ada3f99..0fd4141 100644 (file)
@@ -665,7 +665,6 @@ cleanup:
        g_object_unref (parent_win);
        g_object_unref (msg);
        g_object_unref (folder);
        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));
 
        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));
 
 
        gtk_dialog_run (GTK_DIALOG (dialog));