Fix lambda capture in findDbusObjects
In findDbusObjects(), the interfaces variable was getting moved as part
of the async method callback creation, but was then used after that as
part of the async method call arguments. Change the lambda to capture
it by value so that it is still usable as an argument to the GetSubTree
D-Bus method call.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ia81df828759292fac3157d37bf797c9d7c03c8f0
diff --git a/src/EntityManager.cpp b/src/EntityManager.cpp
index aa1df20..ccca133 100644
--- a/src/EntityManager.cpp
+++ b/src/EntityManager.cpp
@@ -199,9 +199,9 @@
// find all connections in the mapper that expose a specific type
SYSTEM_BUS->async_method_call(
- [interfaces{std::move(interfaces)}, probeVector{std::move(probeVector)},
- scan, retries](boost::system::error_code& ec,
- const GetSubTreeType& interfaceSubtree) mutable {
+ [interfaces, probeVector{std::move(probeVector)}, scan,
+ retries](boost::system::error_code& ec,
+ const GetSubTreeType& interfaceSubtree) mutable {
boost::container::flat_set<
std::tuple<std::string, std::string, std::string>>
interfaceConnections;