[gnome-online-accounts/gnome-3-8] goaidentity: use proper main context



commit 64aab6a7345e7ae92148fbcd54f66a33244b99fc
Author: Ray Strode <rstrode redhat com>
Date:   Fri Sep 20 13:45:02 2013 -0400

    goaidentity: use proper main context
    
    The previous commit uses the wrong main context, which ultimately
    leads symptoms including crashes and 100% cpu usage.
    
    This commit just tweaks the previous commit a little bit, to use
    the proper context.

 src/goaidentity/goaalarm.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/src/goaidentity/goaalarm.c b/src/goaidentity/goaalarm.c
index 9ccb3b6..56ac054 100644
--- a/src/goaidentity/goaalarm.c
+++ b/src/goaidentity/goaalarm.c
@@ -269,18 +269,14 @@ static void
 on_cancelled (GCancellable *cancellable, gpointer user_data)
 {
   GoaAlarm *self = GOA_ALARM (user_data);
-  GMainContext *main_context;
   GSource *idle_source;
 
-  main_context = g_main_context_ref_thread_default ();
 
   idle_source = g_idle_source_new ();
   g_source_set_priority (idle_source, G_PRIORITY_HIGH_IDLE);
   g_source_set_callback (idle_source, async_alarm_cancel_idle_cb, g_object_ref (self), g_object_unref);
-  g_source_attach (idle_source, main_context);
+  g_source_attach (idle_source, self->priv->context);
   g_source_unref (idle_source);
-
-  g_main_context_unref (main_context);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]