mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 09:16:11 +03:00
fix(terminal): avoid Screen.reset causing use of undefined
Fully reset the kitty image storage instead of using the delete handler, previously this caused a memory corruption / likely segfault due to use of undefined, since the delete handler tries to clear the tracked pins for placements, which it gets from the terminal, for which `undefined` was passed in before.
This commit is contained in:
@ -278,12 +278,9 @@ pub fn reset(self: *Screen) void {
|
|||||||
.page_cell = cursor_rac.cell,
|
.page_cell = cursor_rac.cell,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Clear kitty graphics
|
// Reset kitty graphics storage
|
||||||
self.kitty_images.delete(
|
self.kitty_images.deinit(self.alloc, self);
|
||||||
self.alloc,
|
self.kitty_images = .{ .dirty = true };
|
||||||
undefined, // All image deletion doesn't need the terminal
|
|
||||||
.{ .all = true },
|
|
||||||
);
|
|
||||||
|
|
||||||
// Reset our basic state
|
// Reset our basic state
|
||||||
self.saved_cursor = null;
|
self.saved_cursor = null;
|
||||||
|
Reference in New Issue
Block a user