From 8451b16e88b25405d9877243b253a369fd953243 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 13 Jan 2018 07:46:12 +0100 Subject: 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. --- tracker-pt/pt-api.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tracker-pt/pt-api.cpp') diff --git a/tracker-pt/pt-api.cpp b/tracker-pt/pt-api.cpp index 0a6c8e2b..f64b1d81 100644 --- a/tracker-pt/pt-api.cpp +++ b/tracker-pt/pt-api.cpp @@ -69,6 +69,7 @@ std::tuple pt_pixel_pos_mixin::to_pixel_pos(double x, double y, std::tuple pt_pixel_pos_mixin::to_screen_pos(double px, double py, int w, int h) { + px *= w/(w-1.), py *= h/(h-1.); return std::make_tuple((px - w/2.)/w, -(py - h/2.)/w); } -- cgit v1.2.3