Skip to content

Commit

Permalink
add destructor function
Browse files Browse the repository at this point in the history
  • Loading branch information
joyyueyi committed Dec 27, 2017
1 parent b386ab6 commit 68a3099
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app/src/main/cpp/dssttrack/kcftracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,26 @@ KCFTracker::KCFTracker(bool hog, bool fixed_window, bool multiscale, bool lab)
}
}


// Destructor
KCFTracker::~KCFTracker()
{
printf("KCFTracker Destructor.\n");

_alphaf.release();
_prob.release();
_tmpl.release();
_num.release();
_den.release();
_labCentroids.release();
sf_den.release();
sf_num.release();

hann.release();
s_hann.release();
ysf.release();
}

// Initialize tracker
void KCFTracker::init(const cv::Rect &roi, cv::Mat image)
{
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/cpp/dssttrack/kcftracker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ class KCFTracker : public Tracker
// Constructor
KCFTracker(bool hog = true, bool fixed_window = true, bool multiscale = true, bool lab = true);

//
virtual ~KCFTracker();

// Initialize tracker
virtual void init(const cv::Rect &roi, cv::Mat image);

Expand Down
2 changes: 2 additions & 0 deletions app/src/main/cpp/dssttrack/runtracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ int main(int argc, char* argv[]){
}
// resultsFile.close();

delete &tracker;

return 0;

}

0 comments on commit 68a3099

Please sign in to comment.