summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-01-06 21:11:19 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-01-06 21:11:19 +0100
commitf36c13846be43cd54f3000cb48a04d02da1d8730 (patch)
treed57c40d4d2069beb0f587ac29820e4ee5df7f267 /tracker-pt
parent1baa26f8c13462ebc424605420d8e60a1977e3a8 (diff)
tracker/pt: fix crash
Previously dtor assumed tracker was started before getting deleted. This isn't always true, as in the case of protocol failure.
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 88356771..c4ab5963 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -32,9 +32,13 @@ Tracker_PT::~Tracker_PT()
{
set_command(ABORT);
wait();
- delete video_widget;
+ if (video_widget)
+ delete video_widget;
video_widget = NULL;
- if (video_frame->layout()) delete video_frame->layout();
+ if (video_frame)
+ {
+ if (video_frame->layout()) delete video_frame->layout();
+ }
// fast start/stop causes breakage
portable::sleep(1000);
camera.stop();