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/pt-api.hpp | |
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/pt-api.hpp')
-rw-r--r-- | tracker-pt/pt-api.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tracker-pt/pt-api.hpp b/tracker-pt/pt-api.hpp index 833a640e..0156fdd7 100644 --- a/tracker-pt/pt-api.hpp +++ b/tracker-pt/pt-api.hpp @@ -148,12 +148,14 @@ struct OTR_PT_EXPORT pt_settings final : options::opts struct OTR_PT_EXPORT pt_runtime_traits { + template<typename t> using pointer = std::shared_ptr<t>; + pt_runtime_traits(); virtual ~pt_runtime_traits(); - virtual std::unique_ptr<pt_camera> make_camera() const = 0; - virtual std::unique_ptr<pt_point_extractor> make_point_extractor() const = 0; - virtual std::unique_ptr<pt_frame> make_frame() const = 0; - virtual std::unique_ptr<pt_preview> make_preview(int w, int h) const = 0; + virtual pointer<pt_camera> make_camera() const = 0; + virtual pointer<pt_point_extractor> make_point_extractor() const = 0; + virtual pointer<pt_frame> make_frame() const = 0; + virtual pointer<pt_preview> make_preview(int w, int h) const = 0; virtual QString get_module_name() const = 0; }; |