fix: memory leaks in operations that call cut_selection or cut_to

This commit is contained in:
CJ van den Berg 2025-10-13 13:22:26 +02:00
parent 06788c4243
commit b7343219c1
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 29 additions and 21 deletions

View file

@ -306,7 +306,7 @@ const cmds_ = struct {
const mv = tui.mainview() orelse return;
const ed = mv.get_active_editor() orelse return;
const b = try ed.buf_for_update();
const text, const root = try ed.cut_to(move_noop, b.root);
const text, const root = try ed.cut_to(move_noop, b.root, ed.allocator);
ed.set_clipboard_internal(text);
try ed.update_buf(root);
ed.clamp();