Skip to content

Commit

Permalink
#5231: Modules are noncopyable by design.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
codereader committed May 4, 2020
1 parent 3265d1e commit ab44d76
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/imodule.h
Expand Up @@ -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
*/
Expand Down

0 comments on commit ab44d76

Please sign in to comment.