[fix] fix crash when Unhook KeyboardCapturer on MacOS

This commit is contained in:
dijunkun
2025-11-18 14:07:18 +08:00
parent 1a64c1afef
commit f5d0291b5a

View File

@@ -120,8 +120,14 @@ int KeyboardCapturer::Hook(OnKeyAction on_key_action, void* user_ptr) {
}
int KeyboardCapturer::Unhook() {
if (run_loop_source_) {
CFRelease(run_loop_source_);
}
if (event_tap_) {
CFRelease(event_tap_);
}
return 0;
}