Closed DanielJump closed 3 months ago
Suggested fix:
if (result.code() == -2147023441 /*HRESULT_FROM_WIN32(ERROR_COMMITMENT_LIMIT)*/)
{
throw std::bad_alloc();
}
Stack overflow discussion about this issue. https://stackoverflow.com/questions/5419524/outofmemoryexception-error-commitment-limit-with-a-lot-of-free-memory-in-the-s
There are various error codes that can be used to indicate some kind of resource exhaustion and the error mapping in C++/WinRT is not extensible. In hindsight we should simply have had a single hresult_error
type that encompassed all HRESULT
values and avoided any transformation.
This issue is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Version
No response
Summary
We are seeing this HRESULT get thrown sometimes and think it should be mapped to std::bad_alloc by throw_hresult.
Reproducible example
No response
Expected behavior
No response
Actual behavior
No response
Additional comments
No response