瀏覽代碼

Merge pull request #100 from kleinerm/unlock_fix

Add missing mutex unlock in error path.
TheOnlyJoey 8 年之前
父節點
當前提交
b443deb8d7
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/openhmd.c

+ 3 - 1
src/openhmd.c

@@ -176,8 +176,10 @@ ohmd_device* OHMD_APIENTRY ohmd_list_open_device_s(ohmd_context* ctx, int index,
 		ohmd_driver* driver = (ohmd_driver*)desc->driver_ptr;
 		ohmd_device* device = driver->open_device(driver, desc);
 
-		if (device == NULL)
+		if (device == NULL) {
+			ohmd_unlock_mutex(ctx->update_mutex);
 			return NULL;
+		}
 
 		device->rotation_correction.w = 1;