terminal/kitty-gfx: loading non-chunked image takes data slice ownership

This commit is contained in:
Mitchell Hashimoto
2023-08-20 19:58:49 -07:00
parent 03e0ba9081
commit 59dcb85ad4

View File

@ -221,7 +221,11 @@ fn loadAndAddImage(
}
break :img try chunk.complete(alloc);
} else try Image.load(alloc, cmd);
} else img: {
const img = try Image.load(alloc, cmd);
_ = cmd.toOwnedData();
break :img img;
};
errdefer img.deinit(alloc);
// If the image has no ID, we assign one