From 59dcb85ad4c57b11dfe134fea56e3785354431aa Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 20 Aug 2023 19:58:49 -0700 Subject: [PATCH] terminal/kitty-gfx: loading non-chunked image takes data slice ownership --- src/terminal/kitty/graphics_exec.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/terminal/kitty/graphics_exec.zig b/src/terminal/kitty/graphics_exec.zig index fe9e6e51a..0cf81033d 100644 --- a/src/terminal/kitty/graphics_exec.zig +++ b/src/terminal/kitty/graphics_exec.zig @@ -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