summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-10-22 16:15:36 +0000
committerDavid Robillard <d@drobilla.net>2009-10-22 16:15:36 +0000
commitd98c8e8fa4bb18cbbf2a18b82b11d9949bb00890 (patch)
treefd0a5fa975e491c1641417e8f121159678a3a8ce /gtk2_ardour
parent2eed368c24f3411dc062a90058b1d6be5705444d (diff)
Replace horribly error-prone Sequence/MidiModel/MidiSource locking API with scoped locks that automatically Do The Right Thing.
Make Sequence::read_lock const correct in the process (a read lock can be taken out on a const Sequence, but not a write lock). git-svn-id: svn://localhost/ardour2/branches/3.0@5857 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/midi_region_view.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index ad6e74c0cf..b8f30a5da8 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -772,7 +772,7 @@ MidiRegionView::redisplay_model()
(*i)->invalidate ();
}
- _model->read_lock();
+ MidiModel::ReadLock lock(_model->read_lock());
MidiModel::Notes& notes (_model->notes());
_optimization_iterator = _events.begin();
@@ -832,8 +832,6 @@ MidiRegionView::redisplay_model()
display_sysexes();
display_program_changes();
- _model->read_unlock();
-
_marked_for_selection.clear ();
_marked_for_velocity.clear ();