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:
jchen10 2022-08-02 15:32:45 +00:00 committed by Dawn LUCI CQ
parent 27a70c4d0a
commit 27343ffdb3
1 changed files with 2 additions and 0 deletions

View File

@ -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) {
mDeleter = std::move(rhs.mDeleter);
rhs.mDeleter = nullptr;
}
Blob& Blob::operator=(Blob&& rhs) {
@ -62,6 +63,7 @@ Blob& Blob::operator=(Blob&& rhs) {
mDeleter();
}
mDeleter = std::move(rhs.mDeleter);
rhs.mDeleter = nullptr;
return *this;
}