aboutsummaryrefslogtreecommitdiffstats
path: root/alc/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alc/context.cpp')
-rw-r--r--alc/context.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/alc/context.cpp b/alc/context.cpp
index e02c549b..008c2bf4 100644
--- a/alc/context.cpp
+++ b/alc/context.cpp
@@ -93,7 +93,7 @@ std::atomic<ALCcontext*> ALCcontext::sGlobalContext{nullptr};
thread_local ALCcontext *ALCcontext::sLocalContext{nullptr};
ALCcontext::ThreadCtx::~ThreadCtx()
{
- if(ALCcontext *ctx{ALCcontext::sLocalContext})
+ if(ALCcontext *ctx{std::exchange(ALCcontext::sLocalContext, nullptr)})
{
const bool result{ctx->releaseIfNoDelete()};
ERR("Context %p current for thread being destroyed%s!\n", voidp{ctx},