From ca51e2d7e175d70cf2ffad368b727f116ad18326 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Wed, 2 Jun 2021 15:41:39 +0100 Subject: [PATCH] Make memory deinit properly. --- src/qtshit/test.zig | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/qtshit/test.zig b/src/qtshit/test.zig index 1714ab3..d67ddc6 100644 --- a/src/qtshit/test.zig +++ b/src/qtshit/test.zig @@ -130,8 +130,6 @@ test "read/write int variant" { try expect(val.int == 1312); } - - test "read/write qvariantmap" { var byteList = std.ArrayList(u8).init(global_allocator); defer byteList.deinit(); @@ -147,8 +145,13 @@ test "read/write qvariantmap" { var testKey = qmap.get("testkey"); if (testKey) |key| { - try expect(key.int == 1337); + try expect(key.int == 1337); + var qMapIter = qmap.iterator(); + while (qMapIter.next()) |a| { + global_allocator.free(a.key); + } + qmap.deinit(); } else { - try expect(!true); + try expect(!true); } }