From 4a600e1031157cce518985c683fbd05ca9415ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 1 Sep 2023 23:28:41 +0200 Subject: [PATCH] test/wayland: Don't double-free GThreads g_thread_join() frees the thread object, so don't use g_autoptr (Gthread) when they will all be joined. Part-of: --- src/tests/wayland-client-tests.c | 4 ++-- src/tests/wayland-unit-tests.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tests/wayland-client-tests.c b/src/tests/wayland-client-tests.c index 82653b49b..a2231187a 100644 --- a/src/tests/wayland-client-tests.c +++ b/src/tests/wayland-client-tests.c @@ -52,7 +52,7 @@ meta_test_wayland_client_indirect_self_terminate (void) { g_autoptr (MetaWaylandClient) client = NULL; g_autoptr (GError) error = NULL; - g_autoptr (GThread) thread = NULL; + GThread *thread; int fd; gboolean client_destroyed = FALSE; @@ -116,7 +116,7 @@ meta_test_wayland_client_indirect_destroy (void) DestroyTestData data; g_autoptr (MetaWaylandClient) client = NULL; g_autoptr (GError) error = NULL; - g_autoptr (GThread) thread = NULL; + GThread *thread; int fd; gboolean client_destroyed = FALSE; diff --git a/src/tests/wayland-unit-tests.c b/src/tests/wayland-unit-tests.c index 606f4aeb6..fc863d58b 100644 --- a/src/tests/wayland-unit-tests.c +++ b/src/tests/wayland-unit-tests.c @@ -765,9 +765,9 @@ wayland_registry_filter (void) g_autoptr (MetaWaylandClient) client1 = NULL; g_autoptr (MetaWaylandClient) client2 = NULL; g_autoptr (MetaWaylandClient) client3 = NULL; - g_autoptr (GThread) thread1 = NULL; - g_autoptr (GThread) thread2 = NULL; - g_autoptr (GThread) thread3 = NULL; + GThread *thread1; + GThread *thread2; + GThread *thread3; gboolean client1_destroyed = FALSE; gboolean client2_destroyed = FALSE; gboolean client3_destroyed = FALSE;