mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
test_vulkan: don't throw from destructors (#1947)
Only report an error (and include the error code), but don't throw an exception as that would call `terminate`. Failure to release resources is not fatal in other parts of the CTS. This fixes `-Wterminate` warnings: warning: ‘throw’ will always call ‘terminate’ [-Wterminate] note: in C++11 destructors default to ‘noexcept’ Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
committed by
GitHub
parent
43237f74a8
commit
7dc9593d88
@@ -853,7 +853,7 @@ clExternalImportableSemaphore::~clExternalImportableSemaphore()
|
||||
cl_int err = clReleaseSemaphoreKHRptr(m_externalSemaphore);
|
||||
if (err != CL_SUCCESS)
|
||||
{
|
||||
throw std::runtime_error("clReleaseSemaphoreKHR failed!");
|
||||
log_error("clReleaseSemaphoreKHR failed with %d\n", err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -935,7 +935,7 @@ clExternalExportableSemaphore::~clExternalExportableSemaphore()
|
||||
cl_int err = clReleaseSemaphoreKHRptr(m_externalSemaphore);
|
||||
if (err != CL_SUCCESS)
|
||||
{
|
||||
throw std::runtime_error("clReleaseSemaphoreKHR failed!");
|
||||
log_error("clReleaseSemaphoreKHR failed with %d\n", err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1052,4 +1052,4 @@ VulkanImageTiling vkClExternalMemoryHandleTilingAssumption(
|
||||
}
|
||||
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user