diff options
Diffstat (limited to 'src/zenhttp/servers/iothreadpool.cpp')
| -rw-r--r-- | src/zenhttp/servers/iothreadpool.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/zenhttp/servers/iothreadpool.cpp b/src/zenhttp/servers/iothreadpool.cpp index da4b42e28..e941606e2 100644 --- a/src/zenhttp/servers/iothreadpool.cpp +++ b/src/zenhttp/servers/iothreadpool.cpp @@ -33,7 +33,12 @@ WinIoThreadPool::WinIoThreadPool(int InThreadCount, int InMaxThreadCount) WinIoThreadPool::~WinIoThreadPool() { + // this will wait for all callbacks to complete and tear down the `CreateThreadpoolIo` + // object and release all related objects + CloseThreadpoolCleanupGroupMembers(m_CleanupGroup, /* cancel pending callbacks */ TRUE, nullptr); + CloseThreadpoolCleanupGroup(m_CleanupGroup); CloseThreadpool(m_ThreadPool); + DestroyThreadpoolEnvironment(&m_CallbackEnvironment); } void |