Make memory deinit properly.
This commit is contained in:
parent
3ec9353075
commit
ca51e2d7e1
|
@ -130,8 +130,6 @@ test "read/write int variant" {
|
||||||
try expect(val.int == 1312);
|
try expect(val.int == 1312);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test "read/write qvariantmap" {
|
test "read/write qvariantmap" {
|
||||||
var byteList = std.ArrayList(u8).init(global_allocator);
|
var byteList = std.ArrayList(u8).init(global_allocator);
|
||||||
defer byteList.deinit();
|
defer byteList.deinit();
|
||||||
|
@ -147,8 +145,13 @@ test "read/write qvariantmap" {
|
||||||
|
|
||||||
var testKey = qmap.get("testkey");
|
var testKey = qmap.get("testkey");
|
||||||
if (testKey) |key| {
|
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 {
|
} else {
|
||||||
try expect(!true);
|
try expect(!true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue