Make GetContextRef return a ContextRef

This commit is contained in:
Chris Robinson
2018-11-24 14:07:32 -08:00
parent 62d38b1187
commit bd8db0d27b
2 changed files with 5 additions and 6 deletions
+3 -5
View File
@@ -2769,10 +2769,9 @@ static ContextRef VerifyContext(ALCcontext *context)
/* GetContextRef
*
* Returns the currently active context for this thread, and adds a reference
* without locking it.
* Returns a new reference to the currently active context for this thread.
*/
ALCcontext *GetContextRef(void)
ContextRef GetContextRef(void)
{
ALCcontext *context{LocalContext.get()};
if(context)
@@ -2783,8 +2782,7 @@ ALCcontext *GetContextRef(void)
context = GlobalContext.load(std::memory_order_acquire);
if(context) ALCcontext_IncRef(context);
}
return context;
return ContextRef{context};
}
+2 -1
View File
@@ -127,7 +127,6 @@ struct ALCcontext_struct {
DEF_NEWDEL(ALCcontext)
};
ALCcontext *GetContextRef(void);
void ALCcontext_DecRef(ALCcontext *context);
void UpdateContextProps(ALCcontext *context);
@@ -179,6 +178,8 @@ public:
}
};
ContextRef GetContextRef(void);
struct ALcontextProps {
ALfloat DopplerFactor;