Make GetContextRef return a ContextRef
This commit is contained in:
+3
-5
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user