Fix unlinking nullptr error scopes if device init failed
When device initialization failed, DeviceBase::mCurrentErrorScope is nullptr so we need to guard the call to UnlinkForShutdown. Bug: chromium:1081998 Change-Id: I65a1948117fa9461f7fc8d2d1d70aef669bc375d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21685 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
0e5301c23e
commit
6ced832d74
|
@ -154,8 +154,11 @@ namespace dawn_native {
|
||||||
// At this point GPU operations are always finished, so we are in the disconnected state.
|
// At this point GPU operations are always finished, so we are in the disconnected state.
|
||||||
mState = State::Disconnected;
|
mState = State::Disconnected;
|
||||||
|
|
||||||
|
// mCurrentErrorScope can be null if we failed device initialization.
|
||||||
|
if (mCurrentErrorScope.Get() != nullptr) {
|
||||||
|
mCurrentErrorScope->UnlinkForShutdown();
|
||||||
|
}
|
||||||
mErrorScopeTracker = nullptr;
|
mErrorScopeTracker = nullptr;
|
||||||
mCurrentErrorScope->UnlinkForShutdown();
|
|
||||||
mFenceSignalTracker = nullptr;
|
mFenceSignalTracker = nullptr;
|
||||||
mDynamicUploader = nullptr;
|
mDynamicUploader = nullptr;
|
||||||
mMapRequestTracker = nullptr;
|
mMapRequestTracker = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue