[gtksourceview] encoding: fix leak of variant



commit 6ef2138a28d300f1423b91a1db5ca7c654cedf52
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 05674866..5e5cdeb3 100644
--- a/gtksourceview/gtksourceencoding.c
+++ b/gtksourceview/gtksourceencoding.c
@@ -673,8 +673,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]