diff options
author | Robin Gareus <robin@gareus.org> | 2016-04-24 14:39:12 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-04-24 14:43:18 +0200 |
commit | e025c45cda96a3c2bce5f4b4de42dc320af8f667 (patch) | |
tree | 0fdaecb64806349e0997bd649f1a35c421221a7b /gtk2_ardour/audio_clock.cc | |
parent | 667a4aafb5c5a595effbda978678b9ee559498d9 (diff) |
fix crash when loading a session with non-default clock modes.
set_mode() emits ModeChanged which results in save_extra_xml().
If this happens during session-load, the XML iterator is invalidated.
Diffstat (limited to 'gtk2_ardour/audio_clock.cc')
-rw-r--r-- | gtk2_ardour/audio_clock.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 5a05b20894..834f7f31f7 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -1311,7 +1311,7 @@ AudioClock::set_session (Session *s) if ((prop = (*i)->property (X_("mode"))) != 0) { amode = AudioClock::Mode (string_2_enum (prop->value(), amode)); - set_mode (amode); + set_mode (amode, true); } if ((prop = (*i)->property (X_("on"))) != 0) { set_off (!string_is_affirmative (prop->value())); @@ -2112,10 +2112,10 @@ AudioClock::build_ops_menu () MenuList& ops_items = ops_menu->items(); ops_menu->set_name ("ArdourContextMenu"); - ops_items.push_back (MenuElem (_("Timecode"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), Timecode))); - ops_items.push_back (MenuElem (_("Bars:Beats"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), BBT))); - ops_items.push_back (MenuElem (_("Minutes:Seconds"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), MinSec))); - ops_items.push_back (MenuElem (_("Samples"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), Frames))); + ops_items.push_back (MenuElem (_("Timecode"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), Timecode, false))); + ops_items.push_back (MenuElem (_("Bars:Beats"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), BBT, false))); + ops_items.push_back (MenuElem (_("Minutes:Seconds"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), MinSec, false))); + ops_items.push_back (MenuElem (_("Samples"), sigc::bind (sigc::mem_fun(*this, &AudioClock::set_mode), Frames, false))); if (editable && !_off && !is_duration && !_follows_playhead) { ops_items.push_back (SeparatorElem()); @@ -2148,7 +2148,7 @@ AudioClock::locate () } void -AudioClock::set_mode (Mode m) +AudioClock::set_mode (Mode m, bool noemit) { if (_mode == m) { return; @@ -2222,11 +2222,11 @@ AudioClock::set_mode (Mode m) set (last_when, true); - if (!is_transient) { - ModeChanged (); /* EMIT SIGNAL (the static one)*/ - } + if (!is_transient && !noemit) { + ModeChanged (); /* EMIT SIGNAL (the static one)*/ + } - mode_changed (); /* EMIT SIGNAL (the member one) */ + mode_changed (); /* EMIT SIGNAL (the member one) */ } void |