diff options
-rw-r--r-- | alc/alc.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index 1b1e12dd..fad43f7b 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -842,13 +842,6 @@ constexpr ALchar alExtList[] = std::atomic<ALCenum> LastNullDeviceError{ALC_NO_ERROR}; /* Thread-local current context */ -void ReleaseThreadCtx(ALCcontext *context) -{ - const bool result{context->releaseIfNoDelete()}; - ERR("Context %p current for thread being destroyed%s!\n", - decltype(std::declval<void*>()){context}, result ? "" : ", leak detected"); -} - class ThreadCtx { ALCcontext *ctx{nullptr}; @@ -856,8 +849,11 @@ public: ~ThreadCtx() { if(ctx) - ReleaseThreadCtx(ctx); - ctx = nullptr; + { + const bool result{ctx->releaseIfNoDelete()}; + ERR("Context %p current for thread being destroyed%s!\n", + decltype(std::declval<void*>()){ctx}, result ? "" : ", leak detected"); + } } ALCcontext *get() const noexcept { return ctx; } |