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 <timur.pocheptsov@qt.io>
This commit is contained in:
Mårten Nordheim 2019-07-16 10:36:57 +02:00
parent d80bd2f548
commit 19e45ee4c1

View File

@ -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;