summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-06 18:04:30 -0500
committerDavid Robillard <d@drobilla.net>2014-12-06 22:43:06 -0500
commiteb86971d2d1a9c0b81f8f7ca2b87aa744be54976 (patch)
treefcb45999f8c4127703b9d045f3e045d6ffb6c909
parent2ea4ae603aa02f7626a1ecfa15c8ec1ce474b352 (diff)
Invalidate iterator whenever model changes.
I suspect this is an underlying cause of several tricky to reproduce bugs, but we'll have to wait around and see...
-rw-r--r--libs/ardour/midi_source.cc2
-rw-r--r--libs/ardour/smf_source.cc4
2 files changed, 6 insertions, 0 deletions
diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc
index f787d49168..adf28cff09 100644
--- a/libs/ardour/midi_source.cc
+++ b/libs/ardour/midi_source.cc
@@ -397,6 +397,7 @@ void
MidiSource::drop_model ()
{
_model.reset();
+ invalidate();
ModelChanged (); /* EMIT SIGNAL */
}
@@ -404,6 +405,7 @@ void
MidiSource::set_model (boost::shared_ptr<MidiModel> m)
{
_model = m;
+ invalidate();
ModelChanged (); /* EMIT SIGNAL */
}
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index 72f03ba351..e4cfede179 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -613,6 +613,8 @@ SMFSource::load_model (bool lock, bool force_reload)
_model->clear();
}
+ invalidate();
+
if (writable() && !_open) {
return;
}
@@ -712,6 +714,7 @@ SMFSource::destroy_model ()
{
//cerr << _name << " destroying model " << _model.get() << endl;
_model.reset();
+ invalidate();
}
void
@@ -753,6 +756,7 @@ SMFSource::ensure_disk_file ()
_model.reset ();
mm->sync_to_source ();
_model = mm;
+ invalidate();
} else {
/* No model; if it's not already open, it's an empty source, so create
and open it for writing.