diff options
author | Oliver Wolff <oliver.wolff@digia.com> | 2014-02-14 09:22:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-14 10:19:03 +0100 |
commit | 494dc4da7b1d8bc87306d836b37b320657f71f78 (patch) | |
tree | 89a9fda27a23c363ac57e269a5630bd88382398e | |
parent | 51b1dbd4cee002a9132a3c9ccf39240251b95f86 (diff) | |
download | qttools-494dc4da7b1d8bc87306d836b37b320657f71f78.tar.gz qttools-494dc4da7b1d8bc87306d836b37b320657f71f78.tar.bz2 qttools-494dc4da7b1d8bc87306d836b37b320657f71f78.zip |
WinRTRunner: Fixed access violation when listing phone devices
In case of an x64 environment phone devices cannot be listed, but
winrtrunner should not crash in this case.
Change-Id: I6963e1c4f2dc73424fa7ebde13cbce759dfaabc4
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
-rw-r--r-- | src/shared/corecon/corecon.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/corecon/corecon.cpp b/src/shared/corecon/corecon.cpp index 73b52efb..c75f0805 100644 --- a/src/shared/corecon/corecon.cpp +++ b/src/shared/corecon/corecon.cpp @@ -138,7 +138,8 @@ public: CoreConServer::CoreConServer() : d(new CoreConServerPrivate) { HRESULT hr = CoCreateInstance(CLSID_ConMan, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&d->handle)); - qCDebug(lcCoreCon) << "Failed to initialize connection server." << formatError(hr); + if (FAILED(hr)) + qCWarning(lcCoreCon) << "Failed to initialize connection server." << formatError(hr); // The language module is available as long as the above succeeded d->langModule = GetModuleHandle(L"conmanui"); @@ -157,7 +158,7 @@ QList<CoreConDevice *> CoreConServer::devices() const { qCDebug(lcCoreCon) << __FUNCTION__; - if (!d->devices.isEmpty()) + if (!d->devices.isEmpty() || !d->handle) return d->devices; ComPtr<ICcDatastore> dataStore; |