}
}
- auto stopUnit = [&systemDBus](const std::string &unit) {
+ JobWatch watch(systemDBus);
+
+ auto stopUnit = [&watch, &systemDBus](const std::string &unit) {
INFO(SINK, "Stopping unit: " + unit);
- JobWatch watch(systemDBus);
const char* job = NULL;
systemDBus.methodcall("org.freedesktop.systemd1",
"/org/freedesktop/systemd1",