Skip to content

Commit f063fea

Browse files
authored
[DeviceASAN] Fix a UR_L0_LEAKS_DEBUG leak report (#18612)
Some resource destruction is done in the destructor, but if we don't manually clear the map, then the destructor is called after the adapter release, which leads to the leak report and maybe some UB(trying to use adapter after it is released).
1 parent c20712f commit f063fea

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ AsanInterceptor::~AsanInterceptor() {
5050
for (auto &[_, ShadowMemory] : m_ShadowMap) {
5151
ShadowMemory->Destory();
5252
}
53+
m_ShadowMap.clear();
5354

5455
for (auto Adapter : m_Adapters) {
5556
getContext()->urDdiTable.Global.pfnAdapterRelease(Adapter);

0 commit comments

Comments
 (0)