File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
sycl/plugins/unified_runtime Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,19 @@ static void DieUnsupported() {
19
19
20
20
// Adapters may be released by piTearDown being called, or the global dtors
21
21
// being called first. Handle releasing the adapters exactly once.
22
- static void releaseAdapters (std::vector<ur_adapter_handle_t > &Vec) {
22
+ static void releaseAdapters (std::vector<ur_adapter_handle_t > &Vec) noexcept {
23
23
static std::once_flag ReleaseFlag{};
24
- std::call_once (ReleaseFlag, [&]() {
25
- for (auto Adapter : Vec) {
26
- urAdapterRelease (Adapter);
27
- }
28
- urLoaderTearDown ();
29
- });
24
+ try {
25
+ std::call_once (ReleaseFlag, [&]() {
26
+ for (auto Adapter : Vec) {
27
+ urAdapterRelease (Adapter);
28
+ }
29
+ urLoaderTearDown ();
30
+ });
31
+ } catch (...) {
32
+ // Ignore any potential exceptions on teardown. Worst case scenario
33
+ // this just leaks some memory on exit.
34
+ }
30
35
}
31
36
32
37
struct AdapterHolder {
You can’t perform that action at this time.
0 commit comments