aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alcontext.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-21 02:02:53 -0800
committerChris Robinson <[email protected]>2018-11-21 02:02:53 -0800
commit4c64fa1e4e11f39f7b6634e24dee13bb7434927c (patch)
treece3c9d17d9b2f7da14dd5f01bf9496490dae6fb0 /Alc/alcontext.h
parent8ec25da12ec41b1277c9f68390bd5ab29bbcbc52 (diff)
Make VerifyContext return a context reference
Diffstat (limited to 'Alc/alcontext.h')
-rw-r--r--Alc/alcontext.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Alc/alcontext.h b/Alc/alcontext.h
index 1d66ffc6..26616f18 100644
--- a/Alc/alcontext.h
+++ b/Alc/alcontext.h
@@ -157,6 +157,8 @@ class ContextRef {
public:
ContextRef() noexcept = default;
+ ContextRef(ContextRef&& rhs) noexcept : mCtx{rhs.mCtx}
+ { rhs.mCtx = nullptr; }
explicit ContextRef(ALCcontext *ctx) noexcept : mCtx(ctx) { }
~ContextRef() { reset(); }
@@ -173,6 +175,13 @@ public:
ALCcontext* operator->() noexcept { return mCtx; }
ALCcontext* get() noexcept { return mCtx; }
+
+ ALCcontext* release() noexcept
+ {
+ ALCcontext *ret{mCtx};
+ mCtx = nullptr;
+ return ret;
+ }
};