Remove an unnecessary variable

This commit is contained in:
Chris Robinson 2019-08-01 14:29:02 -07:00
parent 65f7fc610e
commit 57e7fff6f6

View File

@ -838,16 +838,14 @@ void ReleaseThreadCtx(ALCcontext *context)
result ? "" : ", leak detected");
}
std::atomic<void(*)(ALCcontext*)> ThreadCtxProc{ReleaseThreadCtx};
class ThreadCtx {
ALCcontext *ctx{nullptr};
public:
~ThreadCtx()
{
auto destruct = ThreadCtxProc.load();
if(destruct && ctx)
destruct(ctx);
if(ctx)
ReleaseThreadCtx(ctx);
ctx = nullptr;
}