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:
Sven van Haastregt
2024-04-16 19:11:08 +02:00
committed by GitHub
parent 43237f74a8
commit 7dc9593d88

View File

@@ -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;
}
}