summaryrefslogtreecommitdiff
path: root/src/lib/job_manager.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-02-20 23:10:50 +0100
committerCarl Hetherington <cth@carlh.net>2025-02-23 01:47:38 +0100
commit81d8c747c7a04be10821223dea69faf058b05b1d (patch)
tree98f58e45012c3133e719024fe8c84d7b9c691811 /src/lib/job_manager.cc
parent6628b2573f601b7448da169453d5f113534e525e (diff)
Allow verification of multiple DCPs in one go (#2843).
Diffstat (limited to 'src/lib/job_manager.cc')
-rw-r--r--src/lib/job_manager.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/job_manager.cc b/src/lib/job_manager.cc
index 86230db2b..3fac8e6fa 100644
--- a/src/lib/job_manager.cc
+++ b/src/lib/job_manager.cc
@@ -177,8 +177,9 @@ JobManager::scheduler ()
} else {
i->resume ();
}
- emit (boost::bind (boost::ref (ActiveJobsChanged), _last_active_job, i->json_name()));
- _last_active_job = i->json_name ();
+ auto last = _last_active_job.lock();
+ emit(boost::bind(boost::ref(ActiveJobsChanged), last ? last->json_name() : std::string{}, i->json_name()));
+ _last_active_job = i;
have_running = true;
} else if (!have_running && i->running()) {
have_running = true;
@@ -195,8 +196,9 @@ JobManager::job_finished ()
{
{
boost::mutex::scoped_lock lm (_mutex);
- emit (boost::bind(boost::ref (ActiveJobsChanged), _last_active_job, optional<string>()));
- _last_active_job = optional<string>();
+ auto job = _last_active_job.lock();
+ emit(boost::bind(boost::ref(ActiveJobsChanged), job ? job->json_name() : string{}, optional<string>()));
+ _last_active_job = {};
}
_schedule_condition.notify_all();