[gnome-software] trivial: Fix an invalid read in the self tests



commit abc42fce58b403f2e215ba18eb67f81ecb85804d
Author: Richard Hughes <richard hughsie com>
Date:   Thu Oct 19 17:19:53 2017 +0100

    trivial: Fix an invalid read in the self tests

 lib/gs-self-test.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/lib/gs-self-test.c b/lib/gs-self-test.c
index 76e1788..2d74ac8 100644
--- a/lib/gs-self-test.c
+++ b/lib/gs-self-test.c
@@ -492,15 +492,15 @@ gs_app_thread_cb (gpointer data)
 static void
 gs_app_thread_func (void)
 {
+       GThread *thread1;
+       GThread *thread2;
        g_autoptr(GsApp) app = gs_app_new ("gimp.desktop");
-       g_autoptr(GThread) thread1 = NULL;
-       g_autoptr(GThread) thread2 = NULL;
 
        /* try really hard to cause a threading problem */
        g_setenv ("G_MESSAGES_DEBUG", "", TRUE);
        thread1 = g_thread_new ("thread1", gs_app_thread_cb, app);
        thread2 = g_thread_new ("thread2", gs_app_thread_cb, app);
-       g_thread_join (thread1);
+       g_thread_join (thread1); /* consumes the reference  */
        g_thread_join (thread2);
        g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
 }


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