SWDEV-366520 - DLL_PROCESS_DETACH update

making sure the current thread is not null before calling ihipDestroyDevice

Change-Id: Ib75e3f9ee1c4e0065986e3fed1065907220f4379


[ROCm/clr commit: c221406681]
이 커밋은 다음에 포함됨:
pghafari 작성하고 Payam Ghafari가 2023-02-21 23:02:24 -05:00를 커밋함
1 부모 013905b593
커밋 24bf83f808
1 파일이 변경됨
+7 -2
+7 -2
파일 보기
@@ -46,9 +46,14 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) {
}
#endif // DEBUG
break;
case DLL_PROCESS_DETACH:
case DLL_PROCESS_DETACH: {
amd::Thread* thread = amd::Thread::current();
if (!(thread != nullptr ||
((thread = new amd::HostThread()) != nullptr && thread == amd::Thread::current()))) {
return true;
}
ihipDestroyDevice();
break;
} break;
case DLL_THREAD_DETACH: {
amd::Thread* thread = amd::Thread::current();
delete thread;