Explicitly reset mDeleter when moving Blob
It's not automatically cleared to empty when moving on ChromeOS, so
the same mDeleter can be executed more than once.
Bug: chromium:1348193
Change-Id: If96a73f0b9bf62b2212a9f47108c465d6c911617
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97865
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/dawn/native/Blob.cpp b/src/dawn/native/Blob.cpp
index ea4d28d..cecac30 100644
--- a/src/dawn/native/Blob.cpp
+++ b/src/dawn/native/Blob.cpp
@@ -53,6 +53,7 @@
Blob::Blob(Blob&& rhs) : mData(rhs.mData), mSize(rhs.mSize) {
mDeleter = std::move(rhs.mDeleter);
+ rhs.mDeleter = nullptr;
}
Blob& Blob::operator=(Blob&& rhs) {
@@ -62,6 +63,7 @@
mDeleter();
}
mDeleter = std::move(rhs.mDeleter);
+ rhs.mDeleter = nullptr;
return *this;
}