Skip to content

Commit 4380e51

Browse files
[SYCL] Clear plugins after unload (#6846)
Unloading plugins was recently separated from the cleanup phase to allow the mock plugin ensure that the mock plugin is the lone plugin. However, after unloading the plugins vector is not currenly cleared. This commit clears the plugins vector after plugins have been unloaded. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 78eb088 commit 4380e51

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sycl/source/detail/global_handler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ void GlobalHandler::unloadPlugins() {
132132
Plugin.unload();
133133
}
134134
}
135+
// Clear after unload to avoid uses after unload.
136+
GlobalHandler::instance().getPlugins().clear();
135137
}
136138

137139
void shutdown() {

0 commit comments

Comments
 (0)