From a8cc5dff8963af8320e3671d44367ef23c09a563 Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Thu, 8 Dec 2022 12:06:59 +0100 Subject: [PATCH] Prevent ObjectLock from being copied Copying an ObjectLock results in the underlying mutex being unlocked too often. There's also no good reason for copying a scoped locking class (if at all, it should be moved). --- lib/base/objectlock.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/base/objectlock.hpp b/lib/base/objectlock.hpp index 277f99041..8e98641db 100644 --- a/lib/base/objectlock.hpp +++ b/lib/base/objectlock.hpp @@ -17,6 +17,9 @@ public: ObjectLock(const Object::Ptr& object); ObjectLock(const Object *object); + ObjectLock(const ObjectLock&) = delete; + ObjectLock& operator=(const ObjectLock&) = delete; + ~ObjectLock(); void Lock();