ESourceRegistry: Use g_main_context_ref_thread_default().
authorMatthew Barnes <mbarnes@redhat.com>
Tue, 19 Jun 2012 11:33:40 +0000 (07:33 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Tue, 19 Jun 2012 12:53:00 +0000 (08:53 -0400)
Slightly more convenient than g_main_context_get_thread_default(), which
requires checking for NULL before referencing the main context ourselves.

libedataserver/e-source-registry.c

index d07a7b8..361d0e2 100644 (file)
@@ -1217,9 +1217,7 @@ e_source_registry_init (ESourceRegistry *registry)
 
        /* This is so the object manager thread can schedule signal
         * emissions on the thread-default context for this thread. */
-       registry->priv->main_context = g_main_context_get_thread_default ();
-       if (registry->priv->main_context != NULL)
-               g_main_context_ref (registry->priv->main_context);
+       registry->priv->main_context = g_main_context_ref_thread_default ();
 
        /* D-Bus object path -> ESource */
        registry->priv->object_path_table =