libobs-winrt: Stronger exception handling
Exceptions were still leaking through somehow.master
parent
3c78a8aa8d
commit
36b7ac432d
|
@ -18,10 +18,14 @@ try {
|
|||
return winrt::Windows::Foundation::Metadata::ApiInformation::
|
||||
IsApiContractPresent(L"Windows.Foundation.UniversalApiContract",
|
||||
8);
|
||||
} catch (winrt::hresult_error &err) {
|
||||
} catch (const winrt::hresult_error &err) {
|
||||
blog(LOG_ERROR, "winrt_capture_supported (0x%08X): %ls", err.to_abi(),
|
||||
err.message().c_str());
|
||||
return false;
|
||||
} catch (...) {
|
||||
blog(LOG_ERROR, "winrt_capture_supported (0x%08X)",
|
||||
winrt::to_hresult());
|
||||
return false;
|
||||
}
|
||||
|
||||
extern "C" EXPORT BOOL winrt_capture_cursor_toggle_supported()
|
||||
|
@ -34,10 +38,14 @@ try {
|
|||
#else
|
||||
return false;
|
||||
#endif
|
||||
} catch (winrt::hresult_error &err) {
|
||||
} catch (const winrt::hresult_error &err) {
|
||||
blog(LOG_ERROR, "winrt_capture_cursor_toggle_supported (0x%08X): %ls",
|
||||
err.to_abi(), err.message().c_str());
|
||||
return false;
|
||||
} catch (...) {
|
||||
blog(LOG_ERROR, "winrt_capture_cursor_toggle_supported (0x%08X)",
|
||||
winrt::to_hresult());
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -353,6 +361,10 @@ try {
|
|||
blog(LOG_ERROR, "CreateForWindow (0x%08X): %ls", err.to_abi(),
|
||||
err.message().c_str());
|
||||
return nullptr;
|
||||
} catch (...) {
|
||||
blog(LOG_ERROR, "CreateForWindow (0x%08X)",
|
||||
winrt::to_hresult());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice
|
||||
|
@ -406,10 +418,13 @@ try {
|
|||
|
||||
return capture;
|
||||
|
||||
} catch (winrt::hresult_error &err) {
|
||||
} catch (const winrt::hresult_error &err) {
|
||||
blog(LOG_ERROR, "winrt_capture_init (0x%08X): %ls", err.to_abi(),
|
||||
err.message().c_str());
|
||||
return nullptr;
|
||||
} catch (...) {
|
||||
blog(LOG_ERROR, "winrt_capture_init (0x%08X)", winrt::to_hresult());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
extern "C" EXPORT void winrt_capture_free(struct winrt_capture *capture)
|
||||
|
|
Loading…
Reference in New Issue