Make memory deinit properly.

This commit is contained in:
Kitteh 2021-06-02 15:41:39 +01:00
parent 3ec9353075
commit ca51e2d7e1

View file

@ -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();
@ -148,6 +146,11 @@ test "read/write qvariantmap" {
var testKey = qmap.get("testkey");
if (testKey) |key| {
try expect(key.int == 1337);
var qMapIter = qmap.iterator();
while (qMapIter.next()) |a| {
global_allocator.free(a.key);
}
qmap.deinit();
} else {
try expect(!true);
}