Skip to content

Commit

Permalink
fix crash when hook_start without permission in darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
seasonyuu committed Sep 12, 2024
1 parent 8f08421 commit 8aa907c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/uiohook_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ void hook_thread_proc(void* arg) {
// Make sure we signal that we have passed any exception throwing code for
// the waiting hook_enable().
uv_cond_signal(&hook_control_cond);
uv_mutex_unlock(&hook_control_mutex);
}

int hook_enable() {
Expand Down Expand Up @@ -140,8 +139,9 @@ int hook_enable() {
status = UIOHOOK_SUCCESS;
}

logger_proc(LOG_LEVEL_DEBUG, "%s [%u]: Thread Result: (%#X).\n",
__FUNCTION__, __LINE__, status);
if (status != UIOHOOK_SUCCESS) {
uv_mutex_unlock(&hook_running_mutex);
}
}
else {
status = UIOHOOK_ERROR_THREAD_CREATE;
Expand Down

0 comments on commit 8aa907c

Please sign in to comment.