aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-04-28 22:28:32 -0700
committerChris Robinson <[email protected]>2023-04-28 22:28:32 -0700
commit102789d4487a8dbbb13a131dde3d21a612e86adb (patch)
treed4965caf413f69edb0afbefa7d10c8cdc54565b5
parent7fc3a1012eedccc8ac125dc38f0c4e2f5af0458c (diff)
Unset sLocalContext when releasing it
-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},