Fix issue boostpython not stopped by Ctrl+c
[trackerpp.git] / src / Engine.cpp
index 6d44f3c..78af761 100644 (file)
@@ -6,7 +6,7 @@
 
 using namespace suanzi;
 
-const static std::string TAG = "Engine";
+static const std::string TAG = "Engine";
 
 static std::mutex g_mutex;
 static EngineWPtr g_instance;
@@ -34,22 +34,22 @@ Engine::Engine()
 
 Engine::~Engine()
 {    
+    destroy();
 }
 
 void Engine::destroy()
 {
+    LOG_DEBUG(TAG, "destroy");
+    detector.reset();
+    multiTracker.reset();
+    reader.reset();
+    observer_list.clear();
 }
 
 
 void Engine::setVideoSrc(VideoSrcType type, const std::string& url)
 {
-    PredictorWrapperPtr pp = PredictorWrapper::create("./python/model.pkl");
-
-    pp->dump();
-
-//    videoSrc = url;
-    //reader = VideoReaderFactory::createVideoReader(type, url);
-
+    reader = VideoReaderFactory::createVideoReader(type, url);
 }
 
 void Engine::run()