mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Don't unregister trim callback during process shutdown.
Resolves: NEO-4668 Signed-off-by: Piotr Zdunowski <piotr.zdunowski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d80afd6d0c
commit
a555f28bf8
@@ -959,10 +959,20 @@ VOID *Wddm::registerTrimCallback(PFND3DKMT_TRIMNOTIFICATIONCALLBACK callback, Wd
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
bool Wddm::isShutdownInProgress() {
|
||||
auto handle = GetModuleHandleA("ntdll.dll");
|
||||
|
||||
if (!handle) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto RtlDllShutdownInProgress = reinterpret_cast<BOOLEAN(WINAPI *)()>(GetProcAddress(handle, "RtlDllShutdownInProgress"));
|
||||
return RtlDllShutdownInProgress();
|
||||
}
|
||||
|
||||
void Wddm::unregisterTrimCallback(PFND3DKMT_TRIMNOTIFICATIONCALLBACK callback, VOID *trimCallbackHandle) {
|
||||
DEBUG_BREAK_IF(callback == nullptr);
|
||||
if (trimCallbackHandle == nullptr) {
|
||||
if (trimCallbackHandle == nullptr || isShutdownInProgress()) {
|
||||
return;
|
||||
}
|
||||
D3DKMT_UNREGISTERTRIMNOTIFICATION unregisterTrimNotification;
|
||||
|
||||
Reference in New Issue
Block a user