mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
fix(terminal/PageList): clear cells in truncated rows during clone
Previously this was a memory leak, styles and graphemes in these rows were never reclaimed.
This commit is contained in:

committed by
Mitchell Hashimoto

parent
69af3f3759
commit
a7e6f1a070
@ -490,6 +490,12 @@ pub fn clone(
|
|||||||
src.* = old_dst;
|
src.* = old_dst;
|
||||||
dirty.setValue(i, dirty.isSet(i + chunk.start));
|
dirty.setValue(i, dirty.isSet(i + chunk.start));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We need to clear the rows we're about to truncate.
|
||||||
|
for (len..page.data.size.rows) |i| {
|
||||||
|
page.data.clearCells(&rows[i], 0, page.data.size.cols);
|
||||||
|
}
|
||||||
|
|
||||||
page.data.size.rows = @intCast(len);
|
page.data.size.rows = @intCast(len);
|
||||||
total_rows += len;
|
total_rows += len;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user