Skip to content

Commit 9e19c16

Browse files
committed
fix(c_sync): unlock when returning early - fixes #641
Signed-off-by: Benn Snyder <[email protected]>
1 parent 4d6b941 commit 9e19c16

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ include (SetupDirectories)
4747

4848
set (PROJECT_VER_MAJOR 0)
4949
set (PROJECT_VER_MINOR 6)
50-
set (PROJECT_VER_PATCH 2)
50+
set (PROJECT_VER_PATCH 3)
5151
set (PROJECT_VER
5252
"${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}")
5353
set (PROJECT_APIVER

wrappers/c_sync/libfreenect_sync.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,11 @@ static int setup_kinect(int index, int res, int fmt, int is_depth)
284284
int thread_running_prev = thread_running;
285285
if (!thread_running) {
286286
int ret = init_thread();
287-
if (ret != 0) return ret;
287+
if (ret != 0) {
288+
pthread_mutex_unlock(&runloop_lock);
289+
pending_runloop_tasks_dec();
290+
return ret;
291+
}
288292
}
289293
if (!kinects[index]) {
290294
kinects[index] = alloc_kinect(index);

0 commit comments

Comments
 (0)