diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-05-13 21:57:40 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-05-13 21:57:40 +0100 |
| commit | 05c37bfdb86be26497d5baa448a0cbda20e33bed (patch) | |
| tree | fed504a9785d818940097810968b6cccb5780b3f /src/lib/job_manager.cc | |
| parent | 6718fb9d02d0b55ccd00eda8faa027972d46a4b4 (diff) | |
Fix crashes on x-thread signal emission.
Fix crashes on x-thread signal emission if the emitting object
is destroyed between the storage of the message on the queue
and the emission of the object in the UI thread.
Diffstat (limited to 'src/lib/job_manager.cc')
| -rw-r--r-- | src/lib/job_manager.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/lib/job_manager.cc b/src/lib/job_manager.cc index 2b727b0aa..63db662d0 100644 --- a/src/lib/job_manager.cc +++ b/src/lib/job_manager.cc @@ -64,9 +64,7 @@ JobManager::add (shared_ptr<Job> j) _jobs.push_back (j); } - if (ui_signaller) { - ui_signaller->emit (boost::bind (boost::ref (JobAdded), weak_ptr<Job> (j))); - } + emit (boost::bind (boost::ref (JobAdded), weak_ptr<Job> (j))); return j; } @@ -138,9 +136,7 @@ JobManager::scheduler () if (active_jobs != _last_active_jobs) { _last_active_jobs = active_jobs; - if (ui_signaller) { - ui_signaller->emit (boost::bind (boost::ref (ActiveJobsChanged), active_jobs)); - } + emit (boost::bind (boost::ref (ActiveJobsChanged), active_jobs)); } dcpomatic_sleep (1); |
