Because those Widgets are added to managed frames (for search highlight)
the labels inside also need to be managed and not destroyed with the
Option (which happens first).
This fixes various GTK warnings at exit
```
gtk_widget_unparent: assertion 'GTK_IS_WIDGET (widget)' failed
```
Record, move recorded region(s), delete the recorded source, undo.
Undo would undo the region-move, of a region that no longer
exists and has no source.
This fixes the following issue:
1. Import a file to a new track
2. Delete the track
3. Editor Source list: select imported file,
-> Remove the selected source
-> Yes, remove the Regions and Sources
The Track and Region no longer exist in the Editor,
only the playlist still exists!
The sources to be deleted are found when iterating over whole-file
regions in `EditorSources::remove_selected_sources`. Also
RegionFactory::get_regions_using_source correctly returns
regions, _editor->remove_regions does nothing since there
is no RegionView for the given region(s). This then cashes in
```
libs/ardour/playlist.cc:2400: virtual XMLNode& ARDOUR::Playlist::state(bool) const: Assertion `r->sources ().size () > 0 && r->master_sources ().size () > 0' failed.
```
The eventual goal is to keep the set of used regions
in sync, and allow to remove explicit calls to
`sync_all_regions_with_regions`.
This prevents `all_regions` to retain a reference to
a region that has been destroyed.
* Do not emit signal with source-lock mutex held
* explicitly drop references when called directly; notably from
EditorSources::remove_selected_sources
It is not sufficient to simply drop the first source
of a region. While destroying a whole-file region marks
all its sources as unused, only the source for 1st channel
was explicitly removed.
The session accumulated <Sources>, without corresponding
whole-file Regions. Those can prevent cleanup of unused
sources, particularly when using snapshots.
* It was never called because SourceListBase::set_session
subscribed to the signal just before SessionHandle::set_session
dropped _session_connections
* remove_source() only checked the first source of the whole-file
region, not all sources of a multi-channel region.
Stereo regions with mono sources are now properly cleaned up.
* the process of tempo mapping requires/encourages you to click on the
last-known good marker, before continuing to make tempo tweaks
* this conflicts with the idea that clicking in a ruler should start a
playhead-drag. TBD. but tempo-mapping is a special and rare operation.