make qvariantmap deinit work properly.
This commit is contained in:
parent
09066b3033
commit
83ee7b5c5f
|
@ -128,6 +128,9 @@ pub fn freeQVariant(variant: QVariant, allocator: *std.mem.Allocator) void {
|
||||||
allocator.free(v.key);
|
allocator.free(v.key);
|
||||||
freeQVariant(v.value, allocator);
|
freeQVariant(v.value, allocator);
|
||||||
}
|
}
|
||||||
|
// Compiler bug maybe? doesnt want me to drop const so have to store it in a variable
|
||||||
|
var qi = q;
|
||||||
|
qi.deinit();
|
||||||
},
|
},
|
||||||
|
|
||||||
.QVariantList => |l| {
|
.QVariantList => |l| {
|
||||||
|
|
|
@ -136,6 +136,7 @@ test "QVariant QVariantMap serialization/deserialization" {
|
||||||
defer qvar.freeQVariant(varient, global_allocator);
|
defer qvar.freeQVariant(varient, global_allocator);
|
||||||
|
|
||||||
var qVariantMap = varient.QVariantMap;
|
var qVariantMap = varient.QVariantMap;
|
||||||
|
|
||||||
var testKey = qVariantMap.get("testkey");
|
var testKey = qVariantMap.get("testkey");
|
||||||
if (testKey) |key| {
|
if (testKey) |key| {
|
||||||
try expect(key.UInt == 1337);
|
try expect(key.UInt == 1337);
|
||||||
|
|
Loading…
Reference in a new issue