Fix input pane usage on Windows 10 IoT Core
Running on Raspberry Pi casting to IInputPane2 fails with E_NO_INTERFACE as there is no input pane available for the device. However, if E_NO_INTERFACE is returned from the lambda, then deletion of the ComPtr holding the AsyncAction in runOnXamlThread() crashes somewhere deep internally of Release(). As we do not check for the return value anywhere, avoid the crash by returning S_OK instead. Change-Id: Icd38ec482b365285a482e5ff792ec1b4f13317d5 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
parent
70fb36e4bd
commit
62984d8918
@ -169,12 +169,12 @@ void QWinRTInputContext::showInputPanel()
|
||||
ComPtr<IInputPane2> inputPane;
|
||||
HRESULT hr = getInputPane(&inputPane);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
return S_OK;
|
||||
boolean success;
|
||||
hr = inputPane->TryShow(&success);
|
||||
if (FAILED(hr) || !success)
|
||||
qErrnoWarning(hr, "Failed to show input panel.");
|
||||
return hr;
|
||||
return S_OK;
|
||||
});
|
||||
}
|
||||
|
||||
@ -184,12 +184,12 @@ void QWinRTInputContext::hideInputPanel()
|
||||
ComPtr<IInputPane2> inputPane;
|
||||
HRESULT hr = getInputPane(&inputPane);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
return S_OK;
|
||||
boolean success;
|
||||
hr = inputPane->TryHide(&success);
|
||||
if (FAILED(hr) || !success)
|
||||
qErrnoWarning(hr, "Failed to hide input panel.");
|
||||
return hr;
|
||||
return S_OK;
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user