summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-11-29 22:02:37 -0600
committerPatrick Williams <patrick@stwcx.xyz>2016-12-02 11:42:45 -0600
commit7904ed64341334649a5c613f7007a449d6899508 (patch)
treef46303840c2b99501e6fe03b055b401918676579
parent213da28e48a761445395c0bfe7b022087a9a35d2 (diff)
downloadsdbusplus-7904ed64341334649a5c613f7007a449d6899508.tar.gz
sdbusplus-7904ed64341334649a5c613f7007a449d6899508.zip
sdbusplus: remove 'move' ops from server bindings
The generated server bindings register 'this' with sdbus, so if a move is allowed then the object pointer left with sdbus no longer exists. Disallow 'move' operations to prevent this. Fixes openbmc/sdbusplus#6. Change-Id: I470b1372042d21ce14ad0cd9bc1af68e7394bcb9 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
-rw-r--r--tools/sdbusplus/templates/interface.mako.server.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/sdbusplus/templates/interface.mako.server.hpp b/tools/sdbusplus/templates/interface.mako.server.hpp
index 77b9ab9..1879fd8 100644
--- a/tools/sdbusplus/templates/interface.mako.server.hpp
+++ b/tools/sdbusplus/templates/interface.mako.server.hpp
@@ -22,15 +22,16 @@ class ${classname}
* Not allowed:
* - Default constructor to avoid nullptrs.
* - Copy operations due to internal unique_ptr.
+ * - Move operations due to 'this' being registered as the
+ * 'context' with sdbus.
* Allowed:
- * - Move operations.
* - Destructor.
*/
${classname}() = delete;
${classname}(const ${classname}&) = delete;
${classname}& operator=(const ${classname}&) = delete;
- ${classname}(${classname}&&) = default;
- ${classname}& operator=(${classname}&&) = default;
+ ${classname}(${classname}&&) = delete;
+ ${classname}& operator=(${classname}&&) = delete;
virtual ~${classname}() = default;
/** @brief Constructor to put object onto bus at a dbus path.
OpenPOWER on IntegriCloud