Correct implementation of DeviceImp::releaseResources

Move checking of neoDevice pointer to the beginning of the function.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
ocldev
2022-09-19 10:36:38 +00:00
committed by Compute-Runtime-Automation
parent 99d63facb5
commit 47860bbb19

View File

@@ -1093,6 +1093,8 @@ void DeviceImp::releaseResources() {
return;
}
UNRECOVERABLE_IF(neoDevice == nullptr);
this->bcsSplit.releaseResources();
if (neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->debugger.get() &&
@@ -1131,10 +1133,8 @@ void DeviceImp::releaseResources() {
}
}
if (neoDevice) {
neoDevice->decRefInternal();
neoDevice = nullptr;
}
neoDevice->decRefInternal();
neoDevice = nullptr;
resourcesReleased = true;
}