summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Nevala <samuel.nevala@intopalo.com>2015-10-22 12:31:12 +0300
committerSamuel Nevala <samuel.nevala@intopalo.com>2015-10-22 16:50:06 +0000
commitac1b772ec8e428acd23322a6fccbde2bda6b8bd2 (patch)
tree498bb23101b6e78ad46cf6686c149b37299d8137
parentf24362fd2a2a783dd8cd42eb42c8270cf4e7b97e (diff)
winrt: Fix crash when focus operation in progress.
If focus is locked repeatedly and fast on Lumia 920 FocusAsync returns null IAsyncAction and ::await crash on null pointer. Fix crash by returning early from method when operation in progress. Change-Id: Ie268fd2276d3e9090a47bf362cd58743bb83284a Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
-rw-r--r--src/plugins/winrt/qwinrtcameracontrol.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/winrt/qwinrtcameracontrol.cpp b/src/plugins/winrt/qwinrtcameracontrol.cpp
index b17256fec..7a926ad60 100644
--- a/src/plugins/winrt/qwinrtcameracontrol.cpp
+++ b/src/plugins/winrt/qwinrtcameracontrol.cpp
@@ -1154,6 +1154,8 @@ bool QWinRTCameraControl::focus()
return false;
ComPtr<IAsyncAction> op;
HRESULT hr = d->focusControl->FocusAsync(&op);
+ if (HRESULT_CODE(hr) == ERROR_OPERATION_IN_PROGRESS)
+ return true;
Q_ASSERT_SUCCEEDED(hr);
hr = QWinRTFunctions::await(op, QWinRTFunctions::ProcessThreadEvents);
Q_ASSERT_SUCCEEDED(hr);