From 07670ed36aeb32e8a7da12110bed1003c46c704e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 27 Nov 2018 10:08:25 -0800 Subject: [PATCH] Swap context references in the move assignment --- Alc/alcontext.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Alc/alcontext.h b/Alc/alcontext.h index 426d06e8..274888e0 100644 --- a/Alc/alcontext.h +++ b/Alc/alcontext.h @@ -168,12 +168,7 @@ public: ContextRef& operator=(const ContextRef&) = delete; ContextRef& operator=(ContextRef&& rhs) noexcept - { - reset(); - mCtx = rhs.mCtx; - rhs.mCtx = nullptr; - return *this; - } + { std::swap(mCtx, rhs.mCtx); return *this; } operator bool() const noexcept { return mCtx != nullptr; }