diff --git a/src/qtshit/qvariant.zig b/src/qtshit/qvariant.zig index 00f9006..74de5d2 100644 --- a/src/qtshit/qvariant.zig +++ b/src/qtshit/qvariant.zig @@ -128,6 +128,9 @@ pub fn freeQVariant(variant: QVariant, allocator: *std.mem.Allocator) void { allocator.free(v.key); 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| { diff --git a/src/qtshit/test.zig b/src/qtshit/test.zig index 28ad77e..82a3fa7 100644 --- a/src/qtshit/test.zig +++ b/src/qtshit/test.zig @@ -136,6 +136,7 @@ test "QVariant QVariantMap serialization/deserialization" { defer qvar.freeQVariant(varient, global_allocator); var qVariantMap = varient.QVariantMap; + var testKey = qVariantMap.get("testkey"); if (testKey) |key| { try expect(key.UInt == 1337);