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>
This commit is contained in:
parent
27a70c4d0a
commit
27343ffdb3
src/dawn/native
|
@ -53,6 +53,7 @@ Blob::Blob(uint8_t* data, size_t size, std::function<void()> deleter)
|
||||||
|
|
||||||
Blob::Blob(Blob&& rhs) : mData(rhs.mData), mSize(rhs.mSize) {
|
Blob::Blob(Blob&& rhs) : mData(rhs.mData), mSize(rhs.mSize) {
|
||||||
mDeleter = std::move(rhs.mDeleter);
|
mDeleter = std::move(rhs.mDeleter);
|
||||||
|
rhs.mDeleter = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Blob& Blob::operator=(Blob&& rhs) {
|
Blob& Blob::operator=(Blob&& rhs) {
|
||||||
|
@ -62,6 +63,7 @@ Blob& Blob::operator=(Blob&& rhs) {
|
||||||
mDeleter();
|
mDeleter();
|
||||||
}
|
}
|
||||||
mDeleter = std::move(rhs.mDeleter);
|
mDeleter = std::move(rhs.mDeleter);
|
||||||
|
rhs.mDeleter = nullptr;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue