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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue