D3D12: check if resource manager exists before releasing
ClusterFuzz injects errors into the device which may not
initialize the resource manager which would later fail upon
shutdown. This adds a check to see if the resource manager
exists before releasing the pool.
BUG=chromium:1117595
Change-Id: Ie2b90f947f3ddd3906ecabc65e959915c1f7e386
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/27040
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
diff --git a/src/dawn_native/d3d12/DeviceD3D12.cpp b/src/dawn_native/d3d12/DeviceD3D12.cpp
index c199bce..295548e 100644
--- a/src/dawn_native/d3d12/DeviceD3D12.cpp
+++ b/src/dawn_native/d3d12/DeviceD3D12.cpp
@@ -571,7 +571,9 @@
}
// Release recycled resource heaps.
- mResourceAllocatorManager->DestroyPool();
+ if (mResourceAllocatorManager != nullptr) {
+ mResourceAllocatorManager->DestroyPool();
+ }
// We need to handle clearing up com object refs that were enqeued after TickImpl
mUsedComObjectRefs.ClearUpTo(std::numeric_limits<Serial>::max());