From fc52f8461996abd0b4f66d59360e870581f19d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 25 Oct 2016 20:38:43 +0200 Subject: converter: free schema type on destruction --- libqmenumodel/src/converter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libqmenumodel/src/converter.cpp b/libqmenumodel/src/converter.cpp index 483e646..cbf8076 100644 --- a/libqmenumodel/src/converter.cpp +++ b/libqmenumodel/src/converter.cpp @@ -272,8 +272,7 @@ GVariant* Converter::toGVariantWithSchema(const QVariant &value, const char* sch } GVariant* result = NULL; - const GVariantType* schema_type; - schema_type = g_variant_type_new(schema); + GVariantType* schema_type = g_variant_type_new(schema); if (g_variant_type_equal(schema_type, G_VARIANT_TYPE_BOOLEAN)) { if (value.canConvert()) { @@ -379,6 +378,9 @@ GVariant* Converter::toGVariantWithSchema(const QVariant &value, const char* sch if (!result) { result = Converter::toGVariant(value); } + + g_free(schema_type); + return result; } -- cgit v1.2.3