summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-02-02 22:42:31 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-02-09 01:48:46 +0000
commita8d3a08eaa148ea62c267be8db2281d3f6bcc9f4 (patch)
tree132ea8d5a55755fe419afdfe6d7b67fa93511957
parent56907e32196fa7e835a54b5e22f771686d619e13 (diff)
downloadphosphor-inventory-manager-a8d3a08eaa148ea62c267be8db2281d3f6bcc9f4.tar.gz
phosphor-inventory-manager-a8d3a08eaa148ea62c267be8db2281d3f6bcc9f4.zip
Fix sigsegv with createObjects
The create objects functor lambda was not properly capturing the input object map. Update the signature to accept an rvalue reference and move construct the lambda copy. Change-Id: I901fd978ea0882d5475b7340a2db1017d7aa443c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
-rw-r--r--actions.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/actions.hpp b/actions.hpp
index 634cbc9..2fea212 100644
--- a/actions.hpp
+++ b/actions.hpp
@@ -41,9 +41,9 @@ namespace actions
{
/** @brief Destroy objects action. */
-inline auto destroyObjects(std::vector<const char*> paths)
+inline auto destroyObjects(std::vector<const char*>&& paths)
{
- return [paths = std::move(paths)](auto&, auto & m)
+ return [=](auto&, auto & m)
{
m.destroyObjects(paths);
};
@@ -51,9 +51,9 @@ inline auto destroyObjects(std::vector<const char*> paths)
/** @brief Create objects action. */
inline auto createObjects(
- const std::map<sdbusplus::message::object_path, Object>& objs)
+ std::map<sdbusplus::message::object_path, Object>&& objs)
{
- return [&objs](auto&, auto & m)
+ return [=](auto&, auto & m)
{
m.createObjects(objs);
};
OpenPOWER on IntegriCloud