Fix removal of punch range

set_auto_punch_location() is a NO-OP when there's no punch range.
This disconnects `punch_connections`, clears session-events,
and emits auto_punch_location_changed().
This commit is contained in:
Robin Gareus 2020-02-27 22:23:59 +01:00
parent 08559abc10
commit 0b027f7678
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1041,6 +1041,11 @@ Locations::remove (Location *loc)
for (i = locations.begin(); i != locations.end(); ++i) {
if ((*i) == loc) {
bool was_loop = (*i)->is_auto_loop();
if ((*i)->is_auto_punch()) {
/* needs to happen before deleting:
* disconnect signals, clear events */
_session.set_auto_punch_location (0);
}
delete *i;
locations.erase (i);
was_removed = true;