Tuple::toGVariant() consumes its input param 51/113651/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 8 Feb 2017 08:42:39 +0000 (17:42 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 8 Feb 2017 08:42:39 +0000 (17:42 +0900)
Change-Id: I0cfdeb60ecc88087d88cddc497106bda773a3638
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/shared/Tuple.cpp

index af63c51..06f1b52 100644 (file)
@@ -121,8 +121,11 @@ GVariant* Tuple::toGVariant(std::vector<Tuple*>& tuples)
 
        for (auto& tuple : tuples) {
                g_variant_builder_add_value(&builder, toGVariant(*tuple));
+               delete tuple;
        }
 
+       tuples.clear();
+
        return g_variant_builder_end(&builder);
 }