diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-15 10:14:09 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-15 10:14:09 +0800 |
commit | 68c304d8de8b4a5ebf7a41a38ac32aa6e1e343c4 (patch) | |
tree | f372c9b30b92fc90a108406692f5617bd5f1647b | |
parent | 03a48ca943bd9a9a58bb48d7d16703c4aebe537e (diff) | |
download | gsoc2013-evolution-68c304d8de8b4a5ebf7a41a38ac32aa6e1e343c4.tar gsoc2013-evolution-68c304d8de8b4a5ebf7a41a38ac32aa6e1e343c4.tar.gz gsoc2013-evolution-68c304d8de8b4a5ebf7a41a38ac32aa6e1e343c4.tar.bz2 gsoc2013-evolution-68c304d8de8b4a5ebf7a41a38ac32aa6e1e343c4.tar.lz gsoc2013-evolution-68c304d8de8b4a5ebf7a41a38ac32aa6e1e343c4.tar.xz gsoc2013-evolution-68c304d8de8b4a5ebf7a41a38ac32aa6e1e343c4.tar.zst gsoc2013-evolution-68c304d8de8b4a5ebf7a41a38ac32aa6e1e343c4.zip |
Bug 594528 - Crash when clicked on File->quit
-rw-r--r-- | mail/e-mail-reader.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 9366121192..2eb4bd682c 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -1864,27 +1864,28 @@ static void mail_reader_message_selected_cb (EMailReader *reader, const gchar *uid) { + GSource *source; const gchar *key; - guint source_id; - gpointer data; /* XXX This is kludgy, but we have no other place to store timeout * state information. Addendum: See EAttachmentView for an example * of storing private data in an interface. Clunky but works. */ key = "message-selected-timeout"; - data = g_object_get_data (G_OBJECT (reader), key); - source_id = GPOINTER_TO_UINT (data); - if (source_id > 0) - g_source_remove (source_id); + source = g_timeout_source_new (100); - source_id = g_timeout_add ( - 100, (GSourceFunc) - mail_reader_message_selected_timeout_cb, reader); + g_source_set_priority (source, G_PRIORITY_DEFAULT); - data = GUINT_TO_POINTER (source_id); - g_object_set_data (G_OBJECT (reader), key, data); + g_source_set_callback ( + source, (GSourceFunc) + mail_reader_message_selected_timeout_cb, reader, NULL); + + g_object_set_data_full ( + G_OBJECT (reader), key, source, + (GDestroyNotify) g_source_destroy); + + g_source_attach (source, NULL); e_mail_reader_changed (reader); } |