From f36c13846be43cd54f3000cb48a04d02da1d8730 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 6 Jan 2016 21:11:19 +0100 Subject: 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. --- tracker-pt/ftnoir_tracker_pt.cpp | 8 ++++++-- 1 file 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(); -- cgit v1.2.3