From 2f113446c0e32c9ae2ae84f1cdd01a15eb250531 Mon Sep 17 00:00:00 2001 From: Kareem El-Faramawi Date: Fri, 2 Feb 2018 04:42:20 -0500 Subject: [PATCH] fix(battery): capture path_battery by copy (#992) path_battery goes out of scope, so the stack reference becomes garbage Fixes #985 --- src/modules/battery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 958cb492..7f0ced63 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -82,7 +82,7 @@ namespace modules { }); // Make consumption reader - m_consumption_reader = make_unique([this,&path_battery] { + m_consumption_reader = make_unique([this,path_battery] { float consumption; // if the rate we found was the current, calculate power (P = I*V)