From fc906d93916d04c81ae712e52045ed56c2788adc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 15 Sep 2013 20:00:57 +0200 Subject: Simplify tracker API No need to have a separate finalization function, can just as well sleep in the destructor. --- ftnoir_tracker_ht/ftnoir_tracker_ht.cpp | 4 ++++ ftnoir_tracker_ht/ftnoir_tracker_ht.h | 10 ---------- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'ftnoir_tracker_ht') diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp index 2ca5a3de..27817a0c 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp @@ -149,6 +149,10 @@ Tracker::Tracker() : lck_shm(HT_SHM_NAME, HT_MUTEX_NAME, sizeof(ht_shm_t)), fres Tracker::~Tracker() { + if (shm) { + shm->terminate = true; + subprocess.waitForFinished(5000); + } subprocess.kill(); if (shm) shm->terminate = true; diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h index fcdea140..5b8eb508 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h @@ -27,16 +27,6 @@ public: bool GiveHeadPoseData(double *data); bool enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ; ht_shm_t* shm; - bool NeedsTimeToFinish() { - return true; - } - void WaitForExit() { - if (shm) { - shm->terminate = true; - subprocess.waitForFinished(5000); - } - subprocess.kill(); - } private: QTimer timer; PortableLockedShm lck_shm; -- cgit v1.2.3