Skip to content

Commit

Permalink
fix(c_sync): unlock when returning early - fixes #641
Browse files Browse the repository at this point in the history
Signed-off-by: Benn Snyder <benn.snyder@gmail.com>
  • Loading branch information
piedar committed Sep 24, 2021
1 parent 4d6b941 commit 9e19c16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ include (SetupDirectories)

set (PROJECT_VER_MAJOR 0)
set (PROJECT_VER_MINOR 6)
set (PROJECT_VER_PATCH 2)
set (PROJECT_VER_PATCH 3)
set (PROJECT_VER
"${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}")
set (PROJECT_APIVER
Expand Down
6 changes: 5 additions & 1 deletion wrappers/c_sync/libfreenect_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ static int setup_kinect(int index, int res, int fmt, int is_depth)
int thread_running_prev = thread_running;
if (!thread_running) {
int ret = init_thread();
if (ret != 0) return ret;
if (ret != 0) {
pthread_mutex_unlock(&runloop_lock);
pending_runloop_tasks_dec();
return ret;
}
}
if (!kinects[index]) {
kinects[index] = alloc_kinect(index);
Expand Down

0 comments on commit 9e19c16

Please sign in to comment.