diff options
author | Chris Robinson <[email protected]> | 2023-04-28 22:28:32 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-04-28 22:28:32 -0700 |
commit | 102789d4487a8dbbb13a131dde3d21a612e86adb (patch) | |
tree | d4965caf413f69edb0afbefa7d10c8cdc54565b5 /alc | |
parent | 7fc3a1012eedccc8ac125dc38f0c4e2f5af0458c (diff) |
Unset sLocalContext when releasing it
Diffstat (limited to 'alc')
-rw-r--r-- | alc/context.cpp | 2 |
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}, |