[gtksourceview/gnome-3-24] encoding: fix leak of variant



commit 5249f35ded1877f1c97c01217f57a08e181ea993
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jul 28 00:38:54 2018 -0700

    encoding: fix leak of variant
    
    g_variant_parse() returns a GVariant that does not have a floating
    reference. Therefore, the ref_sink() was raising the reference count to
    two instead of sinking the non-existent floating ref.

 gtksourceview/gtksourceencoding.c | 2 --
 1 file changed, 2 deletions(-)
---
diff --git a/gtksourceview/gtksourceencoding.c b/gtksourceview/gtksourceencoding.c
index 29e41ae0..4511c920 100644
--- a/gtksourceview/gtksourceencoding.c
+++ b/gtksourceview/gtksourceencoding.c
@@ -668,8 +668,6 @@ gtk_source_encoding_get_default_candidates (void)
                g_assert_no_error (error);
        }
 
-       g_variant_ref_sink (encodings_variant);
-
        encodings_strv = g_variant_get_strv (encodings_variant, NULL);
        encodings_list = strv_to_list (encodings_strv);
        g_free ((gpointer) encodings_strv);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]