From 05fd3f25b3a7d9a9124e629cb111d73f4b397f1a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 30 Oct 2023 11:58:23 -0700 Subject: [PATCH] macos: clear content view on window close --- macos/Sources/Features/Terminal/TerminalController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/macos/Sources/Features/Terminal/TerminalController.swift b/macos/Sources/Features/Terminal/TerminalController.swift index 482946f69..6a26dbb04 100644 --- a/macos/Sources/Features/Terminal/TerminalController.swift +++ b/macos/Sources/Features/Terminal/TerminalController.swift @@ -83,6 +83,10 @@ class TerminalController: NSWindowController, NSWindowDelegate, TerminalViewDele //MARK: - NSWindowDelegate func windowWillClose(_ notification: Notification) { + // I don't know if this is required anymore. We previously had a ref cycle between + // the view and the window so we had to nil this out to break it but I think this + // may now be resolved. We should verify that no memory leaks and we can remove this. + self.window?.contentView = nil } //MARK: - TerminalViewDelegate