SWDEV-366520 - DLL_PROCESS_DETACH update

making sure the current thread is not null before calling ihipDestroyDevice

Change-Id: Ib75e3f9ee1c4e0065986e3fed1065907220f4379
このコミットが含まれているのは:
pghafari
2023-02-14 20:35:46 -05:00
committed by Payam Ghafari
コミット c221406681
+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;