mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
terminal: hyperlink deleted callback frees string memory
This commit is contained in:
@ -93,5 +93,21 @@ pub const Set = RefCountedSet(
|
||||
pub fn eql(self: *const @This(), a: Hyperlink, b: Hyperlink) bool {
|
||||
return a.eql(self.page.?.memory, &b);
|
||||
}
|
||||
|
||||
pub fn deleted(self: *const @This(), link: Hyperlink) void {
|
||||
const page = self.page.?;
|
||||
const alloc = &page.string_alloc;
|
||||
switch (link.id) {
|
||||
.implicit => {},
|
||||
.explicit => |v| alloc.free(
|
||||
page.memory,
|
||||
v.offset.ptr(page.memory)[0..v.len],
|
||||
),
|
||||
}
|
||||
alloc.free(
|
||||
page.memory,
|
||||
link.uri.offset.ptr(page.memory)[0..link.uri.len],
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
Reference in New Issue
Block a user