From b372513ba460baea000723c5556e8b3389754970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 15 Mar 2023 16:18:09 +0100 Subject: [PATCH] ReplacedTexture: Opportunistically delete the waitable --- GPU/Common/ReplacedTexture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GPU/Common/ReplacedTexture.cpp b/GPU/Common/ReplacedTexture.cpp index b0823b1a2a..233310176d 100644 --- a/GPU/Common/ReplacedTexture.cpp +++ b/GPU/Common/ReplacedTexture.cpp @@ -186,6 +186,8 @@ bool ReplacedTexture::Poll(double budget) { if (threadWaitable_->WaitFor(budget)) { // If we successfully wait here, we're done. The thread will set state accordingly. _assert_(State() == ReplacementState::ACTIVE || State() == ReplacementState::NOT_FOUND || State() == ReplacementState::CANCEL_INIT); + delete threadWaitable_; + threadWaitable_ = nullptr; return true; } // Still pending on thread.