From e295cb04748ede9935b7e1388d0170c551ccdc9e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 7 Apr 2021 01:25:55 -0400 Subject: [PATCH] k_scoped_lock: delete copy and move assignment operators If we delete the copy and move constructor, we should also be deleting the copy and move assignment operators (and even if this were intended, it would be pretty odd to not document why it's done this way). --- src/core/hle/kernel/k_scoped_lock.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/hle/kernel/k_scoped_lock.h b/src/core/hle/kernel/k_scoped_lock.h index 543555680e..7a1035b8c4 100644 --- a/src/core/hle/kernel/k_scoped_lock.h +++ b/src/core/hle/kernel/k_scoped_lock.h @@ -25,14 +25,17 @@ public: explicit KScopedLock(T* l) : lock_ptr(l) { this->lock_ptr->Lock(); } - explicit KScopedLock(T& l) : KScopedLock(std::addressof(l)) { /* ... */ - } + explicit KScopedLock(T& l) : KScopedLock(std::addressof(l)) {} + ~KScopedLock() { this->lock_ptr->Unlock(); } KScopedLock(const KScopedLock&) = delete; + KScopedLock& operator=(const KScopedLock&) = delete; + KScopedLock(KScopedLock&&) = delete; + KScopedLock& operator=(KScopedLock&&) = delete; private: T* lock_ptr;