summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_PT
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-11-27 23:20:18 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-11-27 23:21:39 +0100
commit502daa65f45952893060a70f5f95d1626d53050a (patch)
tree28002ed2128d4322e0587311c03dd42f5db71dff /FTNoIR_Tracker_PT
parent9990b05efb6fcd806ec5d996310f4a945a0b0fac (diff)
PT: don't crash on camera lackage (issue #9)
Reported-by: runningman84 Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
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()