Skip to content
Snippets Groups Projects
Commit 9cc91816 authored by Ludovico de Nittis's avatar Ludovico de Nittis :palm_tree:
Browse files

locale: fix leaked SrtLocale

parent 7580f37b
Branches
Tags
1 merge request!55locale: fix leaked SrtLocale
Pipeline #1638 passed
......@@ -1378,9 +1378,14 @@ srt_system_info_check_locale (SrtSystemInfo *self,
&local_error);
if (locale != NULL)
maybe = maybe_locale_new_positive (locale);
{
maybe = maybe_locale_new_positive (locale);
g_object_unref (locale);
}
else
maybe = maybe_locale_new_negative (local_error);
{
maybe = maybe_locale_new_negative (local_error);
}
g_hash_table_replace (self->locales.cached_locales,
GUINT_TO_POINTER (quark),
......
......@@ -115,6 +115,7 @@ test_object (Fixture *f,
g_free (req);
g_free (res);
g_free (charset);
g_object_unref (locale);
locale = _srt_locale_new ("en_US",
"en_US",
......@@ -124,6 +125,7 @@ test_object (Fixture *f,
g_assert_cmpstr (srt_locale_get_resulting_name (locale), ==, "en_US");
g_assert_cmpstr (srt_locale_get_charset (locale), ==, "ISO-8859-1");
g_assert_cmpint (srt_locale_is_utf8 (locale), ==, FALSE);
g_object_unref (locale);
}
static void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment