Fixing additional thread lifetime issues

This commit is contained in:
Dan Paulat 2023-09-18 22:22:28 -05:00
parent cc8377064f
commit d58d3fc8e8
4 changed files with 7 additions and 2 deletions

View file

@ -117,7 +117,7 @@ public:
settings_.setCacheDatabasePath(QString {cacheDbPath.c_str()}); settings_.setCacheDatabasePath(QString {cacheDbPath.c_str()});
settings_.setCacheDatabaseMaximumSize(20 * 1024 * 1024); settings_.setCacheDatabaseMaximumSize(20 * 1024 * 1024);
} }
~MainWindowImpl() = default; ~MainWindowImpl() { threadPool_.join(); }
void AsyncSetup(); void AsyncSetup();
void ConfigureMapLayout(); void ConfigureMapLayout();

View file

@ -48,6 +48,9 @@ public:
{ {
std::unique_lock lock(refreshMutex_); std::unique_lock lock(refreshMutex_);
refreshTimer_.cancel(); refreshTimer_.cancel();
lock.unlock();
threadPool_.join();
} }
void HandleMessage(std::shared_ptr<awips::TextProductMessage> message); void HandleMessage(std::shared_ptr<awips::TextProductMessage> message);

View file

@ -108,6 +108,8 @@ public:
// Destroy ImGui Context // Destroy ImGui Context
model::ImGuiContextModel::Instance().DestroyContext(imGuiContextName_); model::ImGuiContextModel::Instance().DestroyContext(imGuiContextName_);
threadPool_.join();
} }
void AddLayer(const std::string& id, void AddLayer(const std::string& id,

View file

@ -35,7 +35,7 @@ public:
radarProductManager_ {radarProductManager} radarProductManager_ {radarProductManager}
{ {
} }
~RadarProductViewImpl() = default; ~RadarProductViewImpl() { threadPool_.join(); }
boost::asio::thread_pool threadPool_ {1}; boost::asio::thread_pool threadPool_ {1};