From ee836d77230f94e6b02442cc3f7901cdc4cff8f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net> 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 4e94509ff..2a68313a2 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -933,7 +933,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;