From 0275a4a171d49229cf7987cafa94adf525f1787b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 29 Apr 2013 20:35:43 +0200 Subject: Plug a memory leak --- facetracknoir/tracker.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'facetracknoir/tracker.h') diff --git a/facetracknoir/tracker.h b/facetracknoir/tracker.h index 0cd7c269..be39e14f 100644 --- a/facetracknoir/tracker.h +++ b/facetracknoir/tracker.h @@ -103,6 +103,8 @@ extern HeadPoseData* GlobalPose; class THeadPoseDOF { public: THeadPoseDOF(QString primary = "", QString secondary= "", int maxInput1 = 50, int maxOutput1 = 180, int maxInput2 = 50, int maxOutput2 = 90) { + curvePtr = NULL; + curvePtrAlt = NULL; QSettings settings("opentrack"); // Registry settings (in HK_USER) QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) @@ -131,6 +133,12 @@ public: FunctionConfig* curvePtrAlt; bool altp; float zero; + ~THeadPoseDOF() { + if (curvePtr) + delete curvePtr; + if (curvePtrAlt) + delete curvePtrAlt; + } }; class Tracker : public QThread { -- cgit v1.2.3