Parcourir la source

Merge pull request #100 from kleinerm/unlock_fix

Add missing mutex unlock in error path.
TheOnlyJoey il y a 8 ans
Parent
commit
b443deb8d7
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  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;