diff --git a/camera/camera_driver.c b/camera/camera_driver.c index 0d572b8852..5a0158fd73 100644 --- a/camera/camera_driver.c +++ b/camera/camera_driver.c @@ -196,7 +196,7 @@ void init_camera(void) system->camera_callback.initialized(); } -void uninit_camera(void) +static void uninit_camera(void) { rarch_system_info_t *system = rarch_system_info_get_ptr(); @@ -235,6 +235,9 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data) break; case RARCH_CAMERA_CTL_IS_ACTIVE: return camera_driver_active; + case RARCH_CAMERA_CTL_DEINIT: + uninit_camera(); + break; default: break; } diff --git a/camera/camera_driver.h b/camera/camera_driver.h index 28a34874ec..82fdd9a43a 100644 --- a/camera/camera_driver.h +++ b/camera/camera_driver.h @@ -28,6 +28,7 @@ extern "C" { enum rarch_camera_ctl_state { RARCH_CAMERA_CTL_NONE = 0, + RARCH_CAMERA_CTL_DEINIT, RARCH_CAMERA_CTL_SET_OWN_DRIVER, RARCH_CAMERA_CTL_UNSET_OWN_DRIVER, RARCH_CAMERA_CTL_OWNS_DRIVER, @@ -127,8 +128,6 @@ void find_camera_driver(void); void init_camera(void); -void uninit_camera(void); - bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data); #ifdef __cplusplus diff --git a/driver.c b/driver.c index 7eb5f3710e..c524570593 100644 --- a/driver.c +++ b/driver.c @@ -434,10 +434,10 @@ void uninit_drivers(int flags) #endif if ((flags & DRIVER_LOCATION) && !location_driver_ctl(RARCH_LOCATION_CTL_OWNS_DRIVER, NULL)) - uninit_location(); + location_driver_ctl(RARCH_LOCATION_CTL_DEINIT, NULL); if ((flags & DRIVER_CAMERA) && !camera_driver_ctl(RARCH_CAMERA_CTL_OWNS_DRIVER, NULL)) - uninit_camera(); + camera_driver_ctl(RARCH_CAMERA_CTL_DEINIT, NULL); if (flags & DRIVER_AUDIO) audio_driver_ctl(RARCH_AUDIO_CTL_DEINIT, NULL); diff --git a/location/location_driver.c b/location/location_driver.c index 208c2a9051..3906d4bc31 100644 --- a/location/location_driver.c +++ b/location/location_driver.c @@ -210,7 +210,7 @@ void init_location(void) system->location_callback.initialized(); } -void uninit_location(void) +static void uninit_location(void) { rarch_system_info_t *system = rarch_system_info_get_ptr(); @@ -233,6 +233,9 @@ bool location_driver_ctl(enum rarch_location_ctl_state state, void *data) switch (state) { + case RARCH_LOCATION_CTL_DEINIT: + uninit_location(); + break; case RARCH_LOCATION_CTL_SET_OWN_DRIVER: location_driver_data_own = true; break; diff --git a/location/location_driver.h b/location/location_driver.h index 827a9620ff..87e90dea58 100644 --- a/location/location_driver.h +++ b/location/location_driver.h @@ -28,6 +28,7 @@ extern "C" { enum rarch_location_ctl_state { RARCH_LOCATION_CTL_NONE = 0, + RARCH_LOCATION_CTL_DEINIT, RARCH_LOCATION_CTL_SET_OWN_DRIVER, RARCH_LOCATION_CTL_UNSET_OWN_DRIVER, RARCH_LOCATION_CTL_OWNS_DRIVER, @@ -135,8 +136,6 @@ void find_location_driver(void); void init_location(void); -void uninit_location(void); - bool location_driver_ctl(enum rarch_location_ctl_state state, void *data); #ifdef __cplusplus