mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Ignored return value SDL bug fix (#6451)
This commit is contained in:
parent
2361cb99b6
commit
783acb144f
3 changed files with 8 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ auto CreateModelAsBuffer(const wchar_t* model_path)
|
|||
}
|
||||
|
||||
static void RawApiTestsApiTestsClassSetup() {
|
||||
RoInitialize(RO_INIT_TYPE::RO_INIT_SINGLETHREADED);
|
||||
WINML_EXPECT_HRESULT_SUCCEEDED(RoInitialize(RO_INIT_TYPE::RO_INIT_SINGLETHREADED));
|
||||
}
|
||||
|
||||
static void CreateModelFromFilePath() {
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ ml::learning_model_device CreateDevice(DeviceType deviceType)
|
|||
}
|
||||
|
||||
static void RawApiTestsGpuApiTestsClassSetup() {
|
||||
RoInitialize(RO_INIT_TYPE::RO_INIT_SINGLETHREADED);
|
||||
WINML_EXPECT_HRESULT_SUCCEEDED(RoInitialize(RO_INIT_TYPE::RO_INIT_SINGLETHREADED));
|
||||
}
|
||||
|
||||
static void CreateDirectXDevice() {
|
||||
|
|
|
|||
|
|
@ -266,7 +266,12 @@ private:
|
|||
|
||||
int32_t Initialize(const char* bytes, size_t size)
|
||||
{
|
||||
RoInitialize(RO_INIT_TYPE::RO_INIT_SINGLETHREADED);
|
||||
auto hr = RoInitialize(RO_INIT_TYPE::RO_INIT_SINGLETHREADED);
|
||||
// https://docs.microsoft.com/en-us/windows/win32/api/roapi/nf-roapi-roinitialize#return-value
|
||||
// RPC_E_CHANGED_MODE indicates already initialized as multithreaded
|
||||
if (hr < 0 && hr != RPC_E_CHANGED_MODE) {
|
||||
return static_cast<int32_t>(hr);
|
||||
}
|
||||
|
||||
// Create in memory stream
|
||||
Microsoft::WRL::ComPtr<IInspectable> in_memory_random_access_stream_insp;
|
||||
|
|
|
|||
Loading…
Reference in a new issue