summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/network/kernel/qnetconmonitor_win.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/kernel/qnetconmonitor_win.cpp b/src/network/kernel/qnetconmonitor_win.cpp
index f9d660d738..a010df8e3a 100644
--- a/src/network/kernel/qnetconmonitor_win.cpp
+++ b/src/network/kernel/qnetconmonitor_win.cpp
@@ -139,7 +139,7 @@ private:
QNetworkConnectionMonitorPrivate *monitor = nullptr;
- QAtomicInteger<ULONG> ref = 1; // start at 1 for our own initial reference
+ QAtomicInteger<ULONG> ref = 0;
DWORD cookie = 0;
};
@@ -346,6 +346,8 @@ QNetworkConnectionMonitorPrivate::~QNetworkConnectionMonitorPrivate()
{
if (comInitFailed)
return;
+ if (monitoring)
+ stopMonitoring();
connectionEvents.Reset();
CoUninitialize();
}
@@ -496,7 +498,7 @@ private:
QNetworkStatusMonitorPrivate *monitor = nullptr;
- QAtomicInteger<ULONG> ref = 1; // start at 1 for our own initial reference
+ QAtomicInteger<ULONG> ref = 0;
DWORD cookie = 0;
};