Invalidate iterator whenever model changes.
authorDavid Robillard <d@drobilla.net>
Sat, 6 Dec 2014 23:04:30 +0000 (18:04 -0500)
committerDavid Robillard <d@drobilla.net>
Sun, 7 Dec 2014 03:43:06 +0000 (22:43 -0500)
I suspect this is an underlying cause of several tricky to reproduce bugs, but
we'll have to wait around and see...

libs/ardour/midi_source.cc
libs/ardour/smf_source.cc

index f787d49168f213bc324826fcec84836765d6f540..adf28cff09fe741af8e24bbe190f6df5edc8f0e4 100644 (file)
@@ -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 */
 }
 
index 72f03ba351bbc4a60ca557543046d14f51c03d45..e4cfede17938c8badfead6e014efd81911691bce 100644 (file)
@@ -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.