Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit50fa7bc

Browse files
liam-middlebrookjp7677
authored andcommitted
nvofapi: Fix initalization failure error handling
1 parentce717dc commit50fa7bc

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎src/nvofapi_d3d12.cpp‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ extern "C" {
4646
nvOF =newnvofapi::NvOFInstanceD3D12(pD3D12Device);
4747
}catch (std::exceptionconst& e) {
4848
log::info(str::format("CreateOpticalFlowD3D12 exception, %s", e.what()));
49-
}
50-
51-
if (!nvOF) {
5249
returnErrorGeneric(n);
5350
}
5451

‎src/nvofapi_vulkan.cpp‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ extern "C" {
4040
if (log::tracing())
4141
log::trace(n,log::fmt::hnd(vkInstance),log::fmt::hnd(vkPhysicalDevice),log::fmt::hnd(vkDevice),log::fmt::ptr(hOFInstance));
4242

43-
auto nvOF =newnvofapi::NvOFInstanceVk(vkInstance, vkPhysicalDevice, vkDevice);
44-
45-
if (!nvOF) {
43+
nvofapi::NvOFInstanceVk* nvOF =nullptr;
44+
try {
45+
nvOF =newnvofapi::NvOFInstanceVk(vkInstance, vkPhysicalDevice, vkDevice);
46+
}catch (std::exceptionconst& e) {
47+
log::info(str::format("CreateOpticalFlowD3D12 exception, %s", e.what()));
4648
returnErrorGeneric(n);
4749
}
4850

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp