mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-06 07:29:08 +00:00
termio: free resources for discarded messages
Messages can own allocated data or a derived config. Some paths (writer thread draining, mailbox shutdown with unread messages, and queue push failures) discarded messages without releasing those resources. This change adds Message.deinit and uses it whenever a message is discarded.
This commit is contained in:
@@ -298,7 +298,7 @@ fn drainMailbox(
|
||||
|
||||
// If we're draining, we just drain the mailbox and return.
|
||||
if (self.flags.drain) {
|
||||
while (mailbox.pop(global.io())) |_| {}
|
||||
while (mailbox.pop(global.io())) |msg| msg.deinit();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user