Explorar o código

Merge pull request #100 from kleinerm/unlock_fix

Add missing mutex unlock in error path.
TheOnlyJoey %!s(int64=8) %!d(string=hai) anos
pai
achega
b443deb8d7
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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;