From fc51bf12338e1320861c5c85d39f9206f38d9596 Mon Sep 17 00:00:00 2001 From: Alan Liddell Date: Tue, 20 Feb 2024 12:24:56 -0500 Subject: [PATCH] Release driver lock on return from `reset_driver_and_replace_camera` (#200) --- src/dcam.driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dcam.driver.c b/src/dcam.driver.c index 5f570e9..a861c61 100644 --- a/src/dcam.driver.c +++ b/src/dcam.driver.c @@ -243,7 +243,7 @@ reset_driver_and_replace_camera(struct Dcam4Camera* self) // try to stop all the associated cameras for (int i = 0; i < ncameras; ++i) { - camera_stop(&driver->cameras[i]->camera); + CHECK(Device_Ok == camera_stop(&driver->cameras[i]->camera)); } // save properties @@ -327,7 +327,7 @@ reset_driver_and_replace_camera(struct Dcam4Camera* self) driver->cameras[i]->camera.device.identifier.name, sizeof(self_name))) { *self = *driver->cameras[i]; - return driver->cameras[i]; + break; } } lock_release(&driver->lock);