static gboolean
idle_notify_progress (gpointer data)
{
+ gdk_threads_enter ();
+
ModestMailOperation *mail_op = MODEST_MAIL_OPERATION (data);
ModestMailOperationState *state;
g_signal_emit (G_OBJECT (mail_op), signals[PROGRESS_CHANGED_SIGNAL], 0, state, NULL);
g_slice_free (ModestMailOperationState, state);
+ gdk_threads_leave ();
+
return TRUE;
}
static gboolean
idle_notify_progress_once (gpointer data)
{
+ gdk_threads_enter ();
+
ModestPair *pair;
pair = (ModestPair *) data;
g_slice_free (ModestMailOperationState, (ModestMailOperationState*)pair->second);
g_object_unref (pair->first);
+ gdk_threads_leave ();
+
return FALSE;
}
* loop. We call it inside an idle call to achieve that
*/
static gboolean
-notify_update_account_queue (gpointer data)
+idle_notify_update_account_queue (gpointer data)
{
+ gdk_threads_enter ();
+
ModestMailOperation *mail_op = MODEST_MAIL_OPERATION (data);
ModestMailOperationPrivate *priv = NULL;
modest_mail_operation_notify_end (mail_op);
g_object_unref (mail_op);
+ gdk_threads_leave ();
+
return FALSE;
}
static gboolean
set_last_updated_idle (gpointer data)
{
+ gdk_threads_enter ();
+
/* It does not matter if the time is not exactly the same than
the time when this idle was called, it's just an
approximation and it won't be very different */
time(NULL),
TRUE);
+ gdk_threads_leave ();
+
return FALSE;
}
/* Notify about operation end. Note that the info could be
freed before this idle happens, but the mail operation will
be still alive */
- g_idle_add (notify_update_account_queue, g_object_ref (info->mail_op));
+ g_idle_add (idle_notify_update_account_queue, g_object_ref (info->mail_op));
if (info->callback) {
/* This thread is not in the main lock */
static gboolean
notify_get_msgs_full (gpointer data)
{
+ gdk_threads_enter ();
+
NotifyGetMsgsInfo *info;
info = (NotifyGetMsgsInfo *) data;
g_slice_free (NotifyGetMsgsInfo, info);
+ gdk_threads_leave ();
+
return FALSE;
}
static gboolean
get_msgs_full_destroyer (gpointer data)
{
+ gdk_threads_enter ();
+
GetFullMsgsInfo *info;
info = (GetFullMsgsInfo *) data;
g_object_unref (info->headers);
g_slice_free (GetFullMsgsInfo, info);
+ gdk_threads_leave ();
+
return FALSE;
}
priv->status = MODEST_MAIL_OPERATION_STATUS_SUCCESS;
/* Notify about operation end */
- g_idle_add (notify_update_account_queue, g_object_ref (info->mail_op));
+ g_idle_add (idle_notify_update_account_queue, g_object_ref (info->mail_op));
/* Free thread resources. Will be called after all previous idles */
g_idle_add_full (G_PRIORITY_DEFAULT_IDLE + 1, get_msgs_full_destroyer, info, NULL);
/* If user defined callback function was defined, call it */
if (helper->user_callback) {
+ gdk_threads_enter ();
helper->user_callback (priv->source, helper->user_data);
+ gdk_threads_leave ();
}
/* Free */
out:
/* Call user defined callback, if it exists */
- if (helper->user_callback)
+ if (helper->user_callback) {
+/* gdk_threads_enter (); */
helper->user_callback (priv->source, folder, helper->user_data);
+/* gdk_threads_leave (); */
+ }
/* Free */
g_object_unref (helper->mail_op);