main: do not capture the whole environment in lambdas
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Fri, 23 Jun 2017 13:09:03 +0000 (15:09 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Tue, 8 Aug 2017 15:24:00 +0000 (17:24 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
src/main.cpp

index 7ff9040..dc67f94 100644 (file)
@@ -134,12 +134,12 @@ int main(int argc, char **argv) {
    struct conn c = {};
 
    d->r->add_global_handler(
-      "ivi_controller", [&](wl_registry *r, uint32_t name, uint32_t v) {
+      "ivi_controller", [&c](wl_registry *r, uint32_t name, uint32_t v) {
          c.c = std::make_unique<genivi::controller>(r, name, v);
       });
 
    d->r->add_global_handler(
-      "wl_output", [&](wl_registry *r, uint32_t name, uint32_t v) {
+      "wl_output", [&c](wl_registry *r, uint32_t name, uint32_t v) {
          c.outputs.emplace_back(std::make_unique<wl::output>(r, name, v));
       });