From 53af7208e60569d3a86b99c385b7db0d2f2989f8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 9 Jun 2023 08:12:56 -0400 Subject: [PATCH] gdk: Fix an oversight in GdkContentFormats When clearing a builder, reset the counts to 0. Otherwise valgrind spots uninitialized memory use in our testsuite. --- gdk/gdkcontentformats.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdk/gdkcontentformats.c b/gdk/gdkcontentformats.c index cb2528fbee..9ca4db3205 100644 --- a/gdk/gdkcontentformats.c +++ b/gdk/gdkcontentformats.c @@ -645,6 +645,9 @@ gdk_content_formats_builder_clear (GdkContentFormatsBuilder *builder) { g_clear_pointer (&builder->gtypes, g_slist_free); g_clear_pointer (&builder->mime_types, g_slist_free); + + builder->n_gtypes = 0; + builder->n_mime_types = 0; } /**