aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2009-07-24 02:48:45 +0800
committerSrinivasa Ragavan <sragavan@novell.com>2009-07-24 02:53:03 +0800
commite502c83e159afd3df74c8ff20cf21e56bfb1a242 (patch)
tree1f4406eb038c4aacea7f5a195285d254c3ad6197 /mail
parentf69c15d69d634a3fb857cc062f91e31055a95863 (diff)
downloadgsoc2013-evolution-e502c83e159afd3df74c8ff20cf21e56bfb1a242.tar
gsoc2013-evolution-e502c83e159afd3df74c8ff20cf21e56bfb1a242.tar.gz
gsoc2013-evolution-e502c83e159afd3df74c8ff20cf21e56bfb1a242.tar.bz2
gsoc2013-evolution-e502c83e159afd3df74c8ff20cf21e56bfb1a242.tar.lz
gsoc2013-evolution-e502c83e159afd3df74c8ff20cf21e56bfb1a242.tar.xz
gsoc2013-evolution-e502c83e159afd3df74c8ff20cf21e56bfb1a242.tar.zst
gsoc2013-evolution-e502c83e159afd3df74c8ff20cf21e56bfb1a242.zip
Unref idle loops in finalize.
Diffstat (limited to 'mail')
-rw-r--r--mail/em-sync-stream.c11
-rw-r--r--mail/em-sync-stream.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/mail/em-sync-stream.c b/mail/em-sync-stream.c
index 7e93b33dde..8c7d266855 100644
--- a/mail/em-sync-stream.c
+++ b/mail/em-sync-stream.c
@@ -89,6 +89,7 @@ emss_process_message (struct _write_msg *msg)
break;
}
+ emss->idle_id = 0;
e_flag_set (msg->done);
return FALSE;
@@ -107,8 +108,10 @@ emss_sync_op (EMSyncStream *emss, enum _write_msg_t op,
msg.len = len;
camel_object_ref (emss);
-
- g_idle_add ((GSourceFunc) emss_process_message, &msg);
+
+ if (emss->idle_id)
+ g_source_remove (emss->idle_id);
+ emss->idle_id = g_idle_add ((GSourceFunc) emss_process_message, &msg);
e_flag_wait (msg.done);
e_flag_free (msg.done);
@@ -162,6 +165,8 @@ emss_stream_close (CamelStream *stream)
if (emss->cancel)
return -1;
+ emss->idle_id = 0;
+
if (mail_in_main_thread ())
return EMSS_CLASS (emss)->sync_close (stream);
else
@@ -187,6 +192,8 @@ em_sync_stream_finalize (EMSyncStream *emss)
{
if (emss->buffer != NULL)
g_string_free (emss->buffer, TRUE);
+ if (emss->idle_id)
+ g_source_remove (emss->idle_id);
}
CamelType
diff --git a/mail/em-sync-stream.h b/mail/em-sync-stream.h
index 16cdc272d1..3d74a02a35 100644
--- a/mail/em-sync-stream.h
+++ b/mail/em-sync-stream.h
@@ -53,6 +53,7 @@ struct _EMSyncStream {
CamelStream parent;
GString *buffer;
gboolean cancel;
+ guint idle_id;
};
struct _EMSyncStreamClass {