aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-24 14:07:32 -0800
committerChris Robinson <[email protected]>2018-11-24 14:07:32 -0800
commitbd8db0d27b50644dad97aa74f8f207d30d6b9490 (patch)
tree70045d4bd1a56c6bbb533e3545e0795f4e8bdb43 /Alc
parent62d38b1187ac3cf64f3e78531a9720279f877e23 (diff)
Make GetContextRef return a ContextRef
Diffstat (limited to 'Alc')
-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;