diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index 5befa67d..2db1f2b0 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -119,7 +119,7 @@ public: settings_.setCacheDatabasePath(QString {cacheDbPath.c_str()}); settings_.setCacheDatabaseMaximumSize(20 * 1024 * 1024); } - ~MainWindowImpl() = default; + ~MainWindowImpl() { threadPool_.join(); } void AsyncSetup(); void ConfigureMapLayout(); diff --git a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp index d44d4fb0..0ad34b9f 100644 --- a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp +++ b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp @@ -48,6 +48,9 @@ public: { std::unique_lock lock(refreshMutex_); refreshTimer_.cancel(); + lock.unlock(); + + threadPool_.join(); } void HandleMessage(std::shared_ptr message); diff --git a/scwx-qt/source/scwx/qt/map/map_widget.cpp b/scwx-qt/source/scwx/qt/map/map_widget.cpp index 25ecac14..4f279ad3 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.cpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.cpp @@ -115,6 +115,8 @@ public: // Destroy ImGui Context model::ImGuiContextModel::Instance().DestroyContext(imGuiContextName_); + + threadPool_.join(); } void AddLayer(const std::string& id, diff --git a/scwx-qt/source/scwx/qt/view/radar_product_view.cpp b/scwx-qt/source/scwx/qt/view/radar_product_view.cpp index 634efed3..934922e3 100644 --- a/scwx-qt/source/scwx/qt/view/radar_product_view.cpp +++ b/scwx-qt/source/scwx/qt/view/radar_product_view.cpp @@ -35,7 +35,7 @@ public: radarProductManager_ {radarProductManager} { } - ~RadarProductViewImpl() = default; + ~RadarProductViewImpl() { threadPool_.join(); } boost::asio::thread_pool threadPool_ {1};