diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-29 20:35:43 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-29 20:35:43 +0200 |
commit | 0275a4a171d49229cf7987cafa94adf525f1787b (patch) | |
tree | 9b665978c00c0d973270292d218ca9b568cce555 | |
parent | dbb5ab72d1f16ce864567dad84a7bf2a586fd0ff (diff) |
Plug a memory leak
-rw-r--r-- | facetracknoir/tracker.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 {
|