deleting regionviews changed the region selection, but the regionview
ptr had not been removed from the RegionViewList. The selection change signal
caused an iteration over the list, and manipulated the deleted regionview.
This worked before because nothing happened to AutomationRegionViews
when an AudioRegionView or MIDIRegionView was selected, and so
testing based on the regionview worked (the potential RV could
be the actual RV).
But when displaying region selection (in any way) on other TimeAxisViews,
the correct test is whether the RegionView shows the same region
as the selected region(view).
A rec-region is added to the streamview just like any other region
(::add_region_view_internal). This subscribes to region->DropReferences.
When the DropReferences is handled first by StreamView::remove_region_view
the corresponding RegionView is destroyed.
This can happen even while recording is still active, eg. when locating
(which stops the current recording).
MidiStreamView::setup_rec_box() is called and crashes in
`dynamic_cast<MidiRegionView*> (rec_regions.back().second);`
due to a use after free.
Strictly speaking this is a logic error in how ::setup_rec_box()
determines if to add or remove the rec-box. But due to the
asynchronous nature of signal emission and transport-state changes
the best solution is to destroy the rec-region at the same
when the RegionView is destroyed.
To reproduce:
* create a session with a MIDI track
* disconnect the input (empty MIDI regions are removed)
* Preferences > Transport > *enable* latched-record-enable
* use the Dummy backend's MIDI generator
* connect Hardware > MIDI > MMC -> Ardour misc > MMC in
OR use JACK-transport to locate while recording.
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
We need to delete all existing region views before we redisplay the track. This
was removed as part of an "experimental performance optimization" in 4f7a4cd233
but playlist switching is a rare and non-performance limited operation
Copyright-holder and year information is extracted from git log.
git history begins in 2005. So (C) from 1998..2005 is lost. Also some
(C) assignment of commits where the committer didn't use --author.
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
This cleans up a lot of false-positives in static analysis
and also helps compilers to optimize code paths in general.
(tagging the fatal stingstream operator as ‘noreturn’ is
far less trivial)