fix(battery): capture path_battery by copy (#992)

path_battery goes out of scope, so the stack reference becomes garbage

Fixes #985
This commit is contained in:
Kareem El-Faramawi 2018-02-02 04:42:20 -05:00 committed by Patrick Ziegler
parent 26abd0f6c4
commit 2f113446c0

View File

@ -82,7 +82,7 @@ namespace modules {
}); });
// Make consumption reader // Make consumption reader
m_consumption_reader = make_unique<consumption_reader>([this,&path_battery] { m_consumption_reader = make_unique<consumption_reader>([this,path_battery] {
float consumption; float consumption;
// if the rate we found was the current, calculate power (P = I*V) // if the rate we found was the current, calculate power (P = I*V)