File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Sources/CodeEditSourceEditor/Find/PanelView Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ final class FindPanel: NSView {
5959 }
6060 }
6161
62+ deinit {
63+ removeEventMonitor ( )
64+ }
65+
6266 required init ? ( coder: NSCoder ) {
6367 fatalError ( " init(coder:) has not been implemented " )
6468 }
@@ -82,9 +86,9 @@ final class FindPanel: NSView {
8286 // MARK: - Event Monitor Management
8387
8488 func addEventMonitor( ) {
85- eventMonitor = NSEvent . addLocalMonitorForEvents ( matching: . keyDown) { [ weak self ] event -> NSEvent ? in
89+ eventMonitor = NSEvent . addLocalMonitorForEvents ( matching: . keyDown) { event -> NSEvent ? in
8690 if event. keyCode == 53 { // if esc pressed
87- self ? . dismiss ( )
91+ self . dismiss ( )
8892 return nil // do not play "beep" sound
8993 }
9094 return event
You can’t perform that action at this time.
0 commit comments