aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alcontext.h
diff options
context:
space:
mode:
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;
+ }
};