aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alcontext.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-25 08:42:43 -0800
committerChris Robinson <[email protected]>2018-11-25 08:42:43 -0800
commitbf4518fe5cbe708b3d6b44855f05b58008a48cc8 (patch)
tree60482d67644528cdbfcdb6d31691be1947362dc4 /Alc/alcontext.h
parent7c0605f09eabb55cd3f1b85474b31bfae584cde9 (diff)
Atuomatically clean up sources with its sublist's destruction
Diffstat (limited to 'Alc/alcontext.h')
-rw-r--r--Alc/alcontext.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Alc/alcontext.h b/Alc/alcontext.h
index b1bbd1af..c6824d78 100644
--- a/Alc/alcontext.h
+++ b/Alc/alcontext.h
@@ -44,6 +44,16 @@ enum class DistanceModel {
struct SourceSubList {
uint64_t FreeMask{~uint64_t{}};
ALsource *Sources{nullptr}; /* 64 */
+
+ SourceSubList() noexcept = default;
+ SourceSubList(const SourceSubList&) = delete;
+ SourceSubList(SourceSubList&& rhs) noexcept : FreeMask{rhs.FreeMask}, Sources{rhs.Sources}
+ { rhs.FreeMask = ~uint64_t{}; rhs.Sources = nullptr; }
+ ~SourceSubList();
+
+ SourceSubList& operator=(const SourceSubList&) = delete;
+ SourceSubList& operator=(SourceSubList&& rhs) noexcept
+ { std::swap(FreeMask, rhs.FreeMask); std::swap(Sources, rhs.Sources); return *this; }
};
/* Effect slots are rather large, and apps aren't likely to have more than one