[evolution-data-server] Revert "tests: Remove unnecessary thread-default context manipulation."



commit 2b389126e4f358719bab2cebd38228ff493ac3d7
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Mar 14 10:23:01 2013 -0400

    Revert "tests: Remove unnecessary thread-default context manipulation."
    
    This reverts commit 11a5e7e43754584fbcfa765277e37a9bfbbfdf5f.
    
    I apparently misunderstood how g_main_context_get_thread_default()
    works when calls from newly-created threads.

 .../libebook/client/test-client-view-operations.c  |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/tests/libebook/client/test-client-view-operations.c 
b/tests/libebook/client/test-client-view-operations.c
index f22a030..776f3b0 100644
--- a/tests/libebook/client/test-client-view-operations.c
+++ b/tests/libebook/client/test-client-view-operations.c
@@ -146,8 +146,9 @@ test_view_thread (ThreadData *data)
        ESource         *source;
        GError          *error = NULL;
 
-       context = g_main_context_get_thread_default ();
+       context    = g_main_context_new ();
        data->loop = g_main_loop_new (context, FALSE);
+       g_main_context_push_thread_default (context);
 
        /* Open the test book client in this thread */
        registry = e_source_registry_new_sync (NULL, &error);
@@ -174,7 +175,9 @@ test_view_thread (ThreadData *data)
        g_object_unref (registry);
 
        g_object_unref (data->client);
+       g_main_context_pop_thread_default (context);
        g_main_loop_unref (data->loop);
+       g_main_context_unref (context);
 
        return NULL;
 }


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