From 27343ffdb3f76daf76229a93928ca28a0428764f Mon Sep 17 00:00:00 2001 From: jchen10 Date: Tue, 2 Aug 2022 15:32:45 +0000 Subject: [PATCH] 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 Reviewed-by: Austin Eng Commit-Queue: Austin Eng Kokoro: Kokoro --- src/dawn/native/Blob.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dawn/native/Blob.cpp b/src/dawn/native/Blob.cpp index ea4d28de92..cecac30e4f 100644 --- a/src/dawn/native/Blob.cpp +++ b/src/dawn/native/Blob.cpp @@ -53,6 +53,7 @@ Blob::Blob(uint8_t* data, size_t size, std::function 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; }