summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_PT
diff options
context:
space:
mode:
Diffstat (limited to 'FTNoIR_Tracker_PT')
-rw-r--r--FTNoIR_Tracker_PT/camera.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/FTNoIR_Tracker_PT/camera.cpp b/FTNoIR_Tracker_PT/camera.cpp
index b4d2509f..5f6db57c 100644
--- a/FTNoIR_Tracker_PT/camera.cpp
+++ b/FTNoIR_Tracker_PT/camera.cpp
@@ -163,7 +163,10 @@ void CVCamera::start()
active_index = desired_index;
cam_info.res_x = cap->get(CV_CAP_PROP_FRAME_WIDTH);
cam_info.res_y = cap->get(CV_CAP_PROP_FRAME_HEIGHT);
- }
+ } else {
+ delete cap;
+ cap = nullptr;
+ }
}
void CVCamera::stop()