From 8b469b714071eccbfd54b67689b5e10620ad4e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 7 Feb 2025 18:48:22 +0100 Subject: [PATCH] gmain: Use atomic logic to init the ref counting Ensure we're consistent with the field usage --- glib/gmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/gmain.c b/glib/gmain.c index 8efcc8692..3bedb2d6c 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -935,7 +935,7 @@ g_source_new (GSourceFuncs *source_funcs, source = (GSource*) g_malloc0 (struct_size); source->priv = g_slice_new0 (GSourcePrivate); source->source_funcs = source_funcs; - source->ref_count = 1; + g_atomic_int_set (&source->ref_count, 1); source->priority = G_PRIORITY_DEFAULT;