Revert "fix: skip cleanup in DllMain when terminating process"

This reverts commit 0b5c9125ac.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2025-06-17 03:46:44 +02:00
committed by Compute-Runtime-Automation
parent 86bca656ea
commit 890182b093
2 changed files with 5 additions and 13 deletions

View File

@@ -17,14 +17,10 @@ BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
L0::globalDriverSetup();
}
if (fdwReason == DLL_PROCESS_DETACH) {
/* If lpvReserved is non-NULL with DLL_PROCESS_DETACH, the process is terminating,
* cleanup should be skipped according to the DllMain spec. */
if (!lpvReserved) {
L0::globalDriverTeardown();
if (L0::globalOsSysmanDriver != nullptr) {
delete L0::globalOsSysmanDriver;
L0::globalOsSysmanDriver = nullptr;
}
L0::globalDriverTeardown();
if (L0::globalOsSysmanDriver != nullptr) {
delete L0::globalOsSysmanDriver;
L0::globalOsSysmanDriver = nullptr;
}
}
return TRUE;