mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-01 09:12:35 +00:00
(driver contexts) Do some more runtime checks
This commit is contained in:
parent
f106a1cfaa
commit
06cc9a5c18
@ -90,13 +90,13 @@ bool driver_camera_start(void)
|
||||
|
||||
void driver_camera_stop(void)
|
||||
{
|
||||
if (driver.camera && driver.camera_data)
|
||||
if (driver.camera && driver.camera->stop && driver.camera_data)
|
||||
driver.camera->stop(driver.camera_data);
|
||||
}
|
||||
|
||||
void driver_camera_poll(void)
|
||||
{
|
||||
if (driver.camera && driver.camera_data)
|
||||
if (driver.camera && driver.camera->poll && driver.camera_data)
|
||||
{
|
||||
driver.camera->poll(driver.camera_data,
|
||||
g_extern.system.camera_callback.frame_raw_framebuffer,
|
||||
@ -134,6 +134,8 @@ void uninit_camera(void)
|
||||
{
|
||||
if (g_extern.system.camera_callback.deinitialized)
|
||||
g_extern.system.camera_callback.deinitialized();
|
||||
driver.camera->free(driver.camera_data);
|
||||
|
||||
if (driver.camera->free)
|
||||
driver.camera->free(driver.camera_data);
|
||||
}
|
||||
}
|
||||
|
@ -84,20 +84,20 @@ bool driver_location_start(void)
|
||||
|
||||
void driver_location_stop(void)
|
||||
{
|
||||
if (driver.location && driver.location_data)
|
||||
if (driver.location && driver.location->stop && driver.location_data)
|
||||
driver.location->stop(driver.location_data);
|
||||
}
|
||||
|
||||
void driver_location_set_interval(unsigned interval_msecs, unsigned interval_distance)
|
||||
{
|
||||
if (driver.location && driver.location_data)
|
||||
if (driver.location && driver.location->set_interval && driver.location_data)
|
||||
driver.location->set_interval(driver.location_data, interval_msecs, interval_distance);
|
||||
}
|
||||
|
||||
bool driver_location_get_position(double *lat, double *lon, double *horiz_accuracy,
|
||||
double *vert_accuracy)
|
||||
{
|
||||
if (driver.location && driver.location_data)
|
||||
if (driver.location && driver.location->get_position && driver.location_data)
|
||||
return driver.location->get_position(driver.location_data, lat, lon, horiz_accuracy, vert_accuracy);
|
||||
|
||||
*lat = 0.0;
|
||||
@ -133,6 +133,8 @@ void uninit_location(void)
|
||||
{
|
||||
if (g_extern.system.location_callback.deinitialized)
|
||||
g_extern.system.location_callback.deinitialized();
|
||||
driver.location->free(driver.location_data);
|
||||
|
||||
if (driver.location->free)
|
||||
driver.location->free(driver.location_data);
|
||||
}
|
||||
}
|
||||
|
@ -85,6 +85,6 @@ void init_osk(void)
|
||||
|
||||
void uninit_osk(void)
|
||||
{
|
||||
if (driver.osk_data && driver.osk)
|
||||
if (driver.osk_data && driver.osk && driver.osk->free)
|
||||
driver.osk->free(driver.osk_data);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user