Browse Source

free cameras on process exit

qr-dialog-test
WebFreak001 4 months ago
committed by Martijn Braam
parent
commit
7314739dfc
No known key found for this signature in database GPG Key ID: C4280ACB000B060F
  1. 14
      src/io_pipeline.c

14
src/io_pipeline.c

@ -236,6 +236,18 @@ setup(MPPipeline *pipeline, const void *data)
mp_device_list_free(device_list);
}
static void
clean_cameras()
{
for (size_t i = 0; i < MP_MAX_CAMERAS; ++i) {
struct camera_info* info = &cameras[i];
if (info->camera) {
mp_camera_free(info->camera);
info->camera = NULL;
}
}
}
void
mp_io_pipeline_start()
{
@ -253,6 +265,8 @@ mp_io_pipeline_stop()
g_source_destroy(capture_source);
}
clean_cameras();
mp_pipeline_free(pipeline);
mp_process_pipeline_stop();

Loading…
Cancel
Save