From ab44d76b9d4b27ccbf4d05cf39fff58d6b18af42 Mon Sep 17 00:00:00 2001 From: codereader Date: Mon, 4 May 2020 14:06:35 +0200 Subject: [PATCH] #5231: Modules are noncopyable by design. If they were copyable, this can catch you in an especially nasty way when using *this instead of this in std::bind() arguments, storing a copy of the module instance in the bind. --- include/imodule.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/imodule.h b/include/imodule.h index b70af7fb0a..3a6015bf1f 100644 --- a/include/imodule.h +++ b/include/imodule.h @@ -142,6 +142,10 @@ class RegisterableModule: public sigc::trackable _compatibilityLevel(MODULE_COMPATIBILITY_LEVEL) {} + // Modules are not copyable + RegisterableModule(const RegisterableModule& other) = delete; + RegisterableModule& operator=(const RegisterableModule& other) = delete; + /** * Destructor */