From 19e45ee4c1007ddb9de4c0be9c4423e75ebe9330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 16 Jul 2019 10:36:57 +0200 Subject: [PATCH] Win: qnetconmon: Use CoInitialize instead of CoInitializeEx Somehow I didn't test using QNetwork{Status,Connection}Monitor together with Gui. In qwindowstheme.cpp we call CoInitialize and as such we cannot use CoInitializeEx with a different thread mode. Change-Id: If4a4441cc2616371d8b7cda72cfad11187d8f153 Reviewed-by: Timur Pocheptsov --- src/network/kernel/qnetconmonitor_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/kernel/qnetconmonitor_win.cpp b/src/network/kernel/qnetconmonitor_win.cpp index 8e3cad59f8..b543508169 100644 --- a/src/network/kernel/qnetconmonitor_win.cpp +++ b/src/network/kernel/qnetconmonitor_win.cpp @@ -332,7 +332,7 @@ bool QNetworkConnectionEvents::stopMonitoring() QNetworkConnectionMonitorPrivate::QNetworkConnectionMonitorPrivate() { - auto hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); + auto hr = CoInitialize(nullptr); if (FAILED(hr)) { qCWarning(lcNetMon) << "Failed to initialize COM:" << errorStringFromHResult(hr); comInitFailed = true; @@ -611,7 +611,7 @@ bool QNetworkListManagerEvents::stop() QNetworkStatusMonitorPrivate::QNetworkStatusMonitorPrivate() { - auto hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); + auto hr = CoInitialize(nullptr); if (FAILED(hr)) { qCWarning(lcNetMon) << "Failed to initialize COM:" << errorStringFromHResult(hr); comInitFailed = true;