macOS: weak self for event monitor to avoid retain cycle for controllers (#4128)
Fixes #3219 We were holding a reference cycle to the base terminal controller. This was preventing the window from ever being fully deallocated.pull/3460/head
commit
d512f56005
|
|
@ -111,8 +111,8 @@ class BaseTerminalController: NSWindowController,
|
|||
// Listen for local events that we need to know of outside of
|
||||
// single surface handlers.
|
||||
self.eventMonitor = NSEvent.addLocalMonitorForEvents(
|
||||
matching: [.flagsChanged],
|
||||
handler: localEventHandler)
|
||||
matching: [.flagsChanged]
|
||||
) { [weak self] event in self?.localEventHandler(event) }
|
||||
}
|
||||
|
||||
deinit {
|
||||
|
|
|
|||
Loading…
Reference in New Issue