diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-13 07:46:12 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-13 07:46:12 +0100 |
commit | 8451b16e88b25405d9877243b253a369fd953243 (patch) | |
tree | d3cea9c9681e82a62a060ab05553ef05d80c9c24 /tracker-pt/ftnoir_tracker_pt.h | |
parent | 53e8b2d41988be69deb800e1ef3cbcfc699a3076 (diff) |
tracker/pt: workaround unexplained leak
Somehow, using unique_ptr causes a leak at destruct time. The stored
pointer isn't freed. It works perfectly fine with shared_ptr.
It seems I'm doing things correctly with a move constructor for
unique_ptr in the Tracker_PT class, as well as the pointer
initialization ctor in `module.cpp'. Who the hell knows what's happening
behind the scenes.
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt.h')
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h index deddeea8..c9c15bc7 100644 --- a/tracker-pt/ftnoir_tracker_pt.h +++ b/tracker-pt/ftnoir_tracker_pt.h @@ -59,20 +59,21 @@ private: QMutex camera_mtx; QMutex data_mtx; - std::unique_ptr<pt_point_extractor> point_extractor; - std::unique_ptr<pt_camera> camera; + template<typename t> + using pointer = typename pt_runtime_traits::pointer<t>; + PointTracker point_tracker; pt_settings s; - std::unique_ptr<cv_video_widget> video_widget; std::unique_ptr<QLayout> layout; - std::vector<vec2> points; - std::unique_ptr<pt_frame> frame; - std::unique_ptr<pt_preview> preview_frame; - QSize preview_size; + pointer<pt_point_extractor> point_extractor; + pointer<pt_camera> camera; + pointer<cv_video_widget> video_widget; + pointer<pt_frame> frame; + pointer<pt_preview> preview_frame; std::atomic<unsigned> point_count = 0; std::atomic<bool> ever_success = false; |