I am getting a memory leak using instruments that goes away as soon as I comment out the KeyCombo dictionary extension... below is the code I am using - any chance you can take a look?
deployment target: 10.15
xcode version: 11.2
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
var myHotkey: HotKey? {
didSet {
guard let myHotkey = myHotkey else { return }
myHotkey.keyDownHandler = { [weak self] in
self?.hotkeyHandler()
}
}
}
var num: Int = 0
func applicationDidFinishLaunching(_ aNotification: Notification) {
self.myHotkey = HotKey(carbonKeyCode: UInt32(47), carbonModifiers: UInt32(2304))
}
func hotkeyHandler() {
self.num += 1
print("hotkey pressed \(num) times")
}
}
I am getting a memory leak using instruments that goes away as soon as I comment out the KeyCombo dictionary extension... below is the code I am using - any chance you can take a look?
deployment target: 10.15 xcode version: 11.2