summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qwinoverlappedionotifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qwinoverlappedionotifier.cpp')
-rw-r--r--src/corelib/io/qwinoverlappedionotifier.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/io/qwinoverlappedionotifier.cpp b/src/corelib/io/qwinoverlappedionotifier.cpp
index 8f4b8be9a3..7ba862c602 100644
--- a/src/corelib/io/qwinoverlappedionotifier.cpp
+++ b/src/corelib/io/qwinoverlappedionotifier.cpp
@@ -122,6 +122,8 @@ public:
mutex.unlock();
}
+ using QThread::isRunning;
+
protected:
void run()
{
@@ -216,6 +218,11 @@ void QWinOverlappedIoNotifier::setEnabled(bool enabled)
*/
bool QWinOverlappedIoNotifier::waitForNotified(int msecs, OVERLAPPED *overlapped)
{
+ if (!iocp->isRunning()) {
+ qWarning("Called QWinOverlappedIoNotifier::waitForNotified on inactive notifier.");
+ return false;
+ }
+
forever {
DWORD result = WaitForSingleObject(hSemaphore, msecs == -1 ? INFINITE : DWORD(msecs));
if (result == WAIT_OBJECT_0) {