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:
Qwerasd
2024-06-24 20:09:37 -04:00
committed by Mitchell Hashimoto
parent 69af3f3759
commit a7e6f1a070

View File

@ -490,6 +490,12 @@ pub fn clone(
src.* = old_dst;
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);
total_rows += len;