diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-10-25 20:38:43 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-10-25 20:38:43 +0200 |
commit | fc52f8461996abd0b4f66d59360e870581f19d97 (patch) | |
tree | 55e1d5eba5597ccf656075b8afdcf53df1cc7453 /libqmenumodel/src | |
parent | edfe13a5191e0df28575a7847e8ce94ac29a3e09 (diff) | |
download | qmenumodel-fc52f8461996abd0b4f66d59360e870581f19d97.tar.gz qmenumodel-fc52f8461996abd0b4f66d59360e870581f19d97.tar.bz2 qmenumodel-fc52f8461996abd0b4f66d59360e870581f19d97.zip |
converter: free schema type on destruction
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r-- | libqmenumodel/src/converter.cpp | 6 |
1 files 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<bool>()) { @@ -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; } |