diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-06-12 00:27:33 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-06-14 23:43:13 +0200 |
| commit | a12a943c99ba4aba122f91c93b078d2e87146b32 (patch) | |
| tree | 93e149bc2d6f9c2ff98aa05c5d51e096dd0c6598 /src/lib/hints.cc | |
| parent | 6d2d4973ccd5d4c78414d28988a74dfa7287f001 (diff) | |
Use a new UISignal which checks thread safety slightly.3052-hang
This adds a wrapper around signals2::signal which checks that emission
happens from the GUI thread, for signals whose handlers must be called
in the UI thread. I'm not sure how helpful it really is but maybe it
catches some bad situations.
Diffstat (limited to 'src/lib/hints.cc')
| -rw-r--r-- | src/lib/hints.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 17aa16d47..5e9756b2b 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -411,11 +411,11 @@ Hints::scan_content(shared_ptr<const Film> film) } if (check_loudness_done && have_text) { - emit(boost::bind(boost::ref(Progress), _("Examining subtitles and closed captions"))); + Progress.emit_ui(this, _("Examining subtitles and closed captions")); } else if (!check_loudness_done && !have_text) { - emit(boost::bind(boost::ref(Progress), _("Examining audio"))); + Progress.emit_ui(this, _("Examining audio")); } else { - emit(boost::bind(boost::ref(Progress), _("Examining audio, subtitles and closed captions"))); + Progress.emit_ui(this, _("Examining audio, subtitles and closed captions")); } auto player = make_shared<Player>(film, Image::Alignment::COMPACT, false); @@ -442,7 +442,7 @@ Hints::scan_content(shared_ptr<const Film> film) if (_stop) { return; } - emit(boost::bind(boost::ref(Pulse))); + Pulse.emit_ui(this); last_pulse = now; } } @@ -536,7 +536,7 @@ try } dcp::filesystem::remove_all(dcp_dir); - emit(boost::bind(boost::ref(Finished))); + Finished.emit_ui(this); } catch (boost::thread_interrupted) { @@ -545,14 +545,14 @@ catch (boost::thread_interrupted) catch (...) { store_current(); - emit(boost::bind(boost::ref(Finished))); + Finished.emit_ui(this); } void Hints::hint(string h) { - emit(boost::bind(boost::ref(Hint), h)); + Hint.emit_ui(this, h); } |
