aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/alc.cpp8
-rw-r--r--Alc/alcontext.h3
2 files changed, 5 insertions, 6 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp
index 46b371ef..40bf25b4 100644
--- a/Alc/alc.cpp
+++ b/Alc/alc.cpp
@@ -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};
}
diff --git a/Alc/alcontext.h b/Alc/alcontext.h
index 9845b686..c9bdddc7 100644
--- a/Alc/alcontext.h
+++ b/Alc/alcontext.h
@@ -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;