diff --git a/src/NotificationRequestPool.cpp b/src/NotificationRequestPool.cpp index 2dd9616..d911eee 100644 --- a/src/NotificationRequestPool.cpp +++ b/src/NotificationRequestPool.cpp @@ -107,6 +107,13 @@ void NotificationRequestPool::operator()() continue; } + // handles are closed...? + if (ret == WAIT_FAILED) + { + // exits function (terminates thread) + break; + } + // index of the request which just got completed const auto index = ret - WAIT_OBJECT_0; // grab associated request