diff --git a/include/LoopClosing.h b/include/LoopClosing.h index 79542f7860..87707fa1ee 100644 --- a/include/LoopClosing.h +++ b/include/LoopClosing.h @@ -47,7 +47,7 @@ class LoopClosing typedef pair,int> ConsistentGroup; typedef map, - Eigen::aligned_allocator > > KeyFrameAndPose; + Eigen::aligned_allocator > > KeyFrameAndPose; public: diff --git a/src/Tracking.cc b/src/Tracking.cc index 62bbc4b24a..bdde2be29c 100644 --- a/src/Tracking.cc +++ b/src/Tracking.cc @@ -2321,12 +2321,17 @@ void Tracking::tcp_receive(moodycamel::ConcurrentQueue* messageQueu // Edge-SLAM: added destructor to destroy all connections on object termination Tracking::~Tracking(){ - keyframe_socket->~TcpSocket(); - frame_socket->~TcpSocket(); + keyframe_socket->setAlive(false); + frame_socket->setAlive(false); map_socket->~TcpSocket(); + // This is just a dummy enqueue to unblock the wait_dequeue function in tcp_send() keyframe_queue.enqueue("exit"); frame_queue.enqueue("exit"); + + keyframe_thread->join(); + frame_thread->join(); + map_thread->join(); } } //namespace ORB_SLAM