Skip to content

Commit 47c9609

Browse files
authored
[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.
1 parent 074218d commit 47c9609

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Error olShutDown_impl() {
231231

232232
for (auto &P : OldContext->Platforms) {
233233
// Host plugin is nullptr and has no deinit
234-
if (!P.Plugin)
234+
if (!P.Plugin || !P.Plugin->is_initialized())
235235
continue;
236236

237237
if (auto Res = P.Plugin->deinit())

0 commit comments

Comments
 (0)