From 0865e2c59e401c2cca3e37d6fc6770f44b4213e0 Mon Sep 17 00:00:00 2001 From: Bart Wyatt Date: Thu, 30 Nov 2017 13:36:37 -0500 Subject: [PATCH] explicitly destroying io_serv at the end of shutdown when the io_serv is stopped it may still own std::functions/lambdas that have captured data in them. If this captured data relies on another system like a logging system, for instance, waiting for destructors to be called by the atexit call may result in them accessing a destroyed system. By explicitly resetting the io_serve after shutdown we in turn release any resources it has while the systems are still alive and well --- application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/application.cpp b/application.cpp index 0f5e6a76b..6969b4ac4 100644 --- a/application.cpp +++ b/application.cpp @@ -164,6 +164,7 @@ void application::shutdown() { running_plugins.clear(); initialized_plugins.clear(); plugins.clear(); + io_serv.reset(); } void application::quit() {