diff --git a/Source/Core/Common/ScopeGuard.h b/Source/Core/Common/ScopeGuard.h index 2e313396a90..9e419f4d870 100644 --- a/Source/Core/Common/ScopeGuard.h +++ b/Source/Core/Common/ScopeGuard.h @@ -13,10 +13,7 @@ class ScopeGuard final public: ScopeGuard(Callable&& finalizer) : m_finalizer(std::forward(finalizer)) {} - ScopeGuard(ScopeGuard&& other) : m_finalizer(std::move(other.m_finalizer)) - { - other.m_finalizer = nullptr; - } + ScopeGuard(ScopeGuard&& other) : m_finalizer(std::move(other.m_finalizer)) { other.Dismiss(); } ~ScopeGuard() { Exit(); } void Dismiss() { m_finalizer.reset(); }