summaryrefslogtreecommitdiff
path: root/offload/liboffload
diff options
context:
space:
mode:
authorCallum Fare <callum@codeplay.com>2025-07-14 16:17:10 +0100
committerGitHub <noreply@github.com>2025-07-14 16:17:10 +0100
commit47c9609a8637b68c0170744ce5c06902512e71ca (patch)
tree9f8423da4c4e42865d517069ff56a08f7ee30a02 /offload/liboffload
parent074218dd1071722ab0dea2a1acb71079ff212bb4 (diff)
[Offload] Check plugins aren't already deinitialized when tearing down (#148642)
This is a hotfix for #148615 - it fixes the issue for me locally. I think a broader issue is that in the test environment we're calling olShutDown from a global destructor in the test binaries. We should do something more controlled, either calling olInit/olShutDown in every test, or move those to a GTest global environment. I didn't do that originally because it looked like it needed changes to LLVM's GTest wrapper.
Diffstat (limited to 'offload/liboffload')
-rw-r--r--offload/liboffload/src/OffloadImpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/offload/liboffload/src/OffloadImpl.cpp b/offload/liboffload/src/OffloadImpl.cpp
index 17a2b00cb714..c4e7f9689a90 100644
--- a/offload/liboffload/src/OffloadImpl.cpp
+++ b/offload/liboffload/src/OffloadImpl.cpp
@@ -231,7 +231,7 @@ Error olShutDown_impl() {
for (auto &P : OldContext->Platforms) {
// Host plugin is nullptr and has no deinit
- if (!P.Plugin)
+ if (!P.Plugin || !P.Plugin->is_initialized())
continue;
if (auto Res = P.Plugin->deinit())