From b121a7916d015a6f8d7a55b945b2ae4ea9fca9db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aur=C3=A9lien=20Zanelli?= Date: Fri, 8 Jul 2016 11:04:37 +0200 Subject: [PATCH] gio/tests/gsettings: fix GSettings reference leaks in some tests GSettings objects were not unreffed in test_flags, test_enums and test_ranges tests and when we skip internationalization tests, ie test_l10n(_context). https://bugzilla.gnome.org/show_bug.cgi?id=768560 --- gio/tests/gsettings.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gio/tests/gsettings.c b/gio/tests/gsettings.c index 1fbfb9464..25bd447e8 100644 --- a/gio/tests/gsettings.c +++ b/gio/tests/gsettings.c @@ -737,7 +737,6 @@ test_l10n (void) str = g_settings_get_string (settings, "error-message"); g_assert_cmpstr (str, ==, "Unbenannt"); - g_object_unref (settings); g_free (str); str = NULL; } @@ -746,6 +745,7 @@ test_l10n (void) setlocale (LC_MESSAGES, locale); g_free (locale); + g_object_unref (settings); } /* Test that message context works as expected with translated @@ -784,7 +784,6 @@ test_l10n_context (void) g_settings_get (settings, "backspace", "s", &str); g_assert_cmpstr (str, ==, "Löschen"); - g_object_unref (settings); g_free (str); str = NULL; } @@ -793,6 +792,7 @@ test_l10n_context (void) setlocale (LC_MESSAGES, locale); g_free (locale); + g_object_unref (settings); } enum @@ -1893,6 +1893,9 @@ test_enums (void) g_free (str); g_assert_cmpint (g_settings_get_enum (settings, "test"), ==, TEST_ENUM_QUUX); + + g_object_unref (direct); + g_object_unref (settings); } static void @@ -2001,6 +2004,9 @@ test_flags (void) g_assert_cmpint (g_settings_get_flags (settings, "f-test"), ==, TEST_FLAGS_TALKING | TEST_FLAGS_LAUGHING); + + g_object_unref (direct); + g_object_unref (settings); } static void @@ -2065,6 +2071,9 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_assert (!g_settings_range_check (settings, "val", value)); g_variant_unref (value); G_GNUC_END_IGNORE_DEPRECATIONS + + g_object_unref (direct); + g_object_unref (settings); } static gboolean -- 2.11.4.GIT