summaryrefslogtreecommitdiff
path: root/src/wx/hints_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-01-26 22:42:18 +0000
committerCarl Hetherington <cth@carlh.net>2019-01-26 22:42:18 +0000
commit755b9af051c73dae5fffbe613fc45d9fd4fbd08d (patch)
tree8efc5a92b62f0e9e04f6593ddab896cd42c22e38 /src/wx/hints_dialog.cc
parent0985598b244ec2b82714a422e5d8381a08c6da35 (diff)
Fix hints object so that its lifetime is (nearly) the same as its thread.
Then when the thread AND Hints object are destroyed we get the Signaller's destructor stuff to stop left-over hint signals being delivered. Also add a hint about > 30fps DCP rates.
Diffstat (limited to 'src/wx/hints_dialog.cc')
-rw-r--r--src/wx/hints_dialog.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc
index 18e8a6f9e..f8d03626f 100644
--- a/src/wx/hints_dialog.cc
+++ b/src/wx/hints_dialog.cc
@@ -40,7 +40,7 @@ using boost::dynamic_pointer_cast;
HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> film, bool ok)
: wxDialog (parent, wxID_ANY, _("Hints"))
, _film (film)
- , _hints (new Hints (film))
+ , _hints (0)
, _finished (false)
{
wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
@@ -82,11 +82,6 @@ HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> film, bool ok)
_film_content_change_connection = locked_film->ContentChange.connect (boost::bind (&HintsDialog::film_content_change, this, _1));
}
- _hints->Hint.connect (bind (&HintsDialog::hint, this, _1));
- _hints->Progress.connect (bind (&HintsDialog::progress, this, _1));
- _hints->Pulse.connect (bind (&HintsDialog::pulse, this));
- _hints->Finished.connect (bind (&HintsDialog::finished, this));
-
film_change (CHANGE_TYPE_DONE);
}
@@ -111,6 +106,12 @@ HintsDialog::film_change (ChangeType type)
_gauge->SetValue (0);
update ();
_finished = false;
+
+ _hints.reset (new Hints (_film));
+ _hints->Hint.connect (bind (&HintsDialog::hint, this, _1));
+ _hints->Progress.connect (bind (&HintsDialog::progress, this, _1));
+ _hints->Pulse.connect (bind (&HintsDialog::pulse, this));
+ _hints->Finished.connect (bind (&HintsDialog::finished, this));
_hints->start ();
}