Fix crash when changing DPI while a marker is selected

~LocationMarkers() emits CatchDeletion, which calls
Selection::remove(ArdourMarker*) which in turn calls
Editor::marker_selection_changed(), which can cause a
heap-use-after-free.

So we first need to clear the location_markers map,
before deleting the markers.
This commit is contained in:
Robin Gareus 2025-04-16 04:53:26 +02:00
parent 95949e6267
commit e26edc93d6
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -66,14 +66,16 @@ using namespace Temporal;
void
Editor::clear_marker_display ()
{
for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
delete i->second;
}
entered_marker = 0;
LocationMarkerMap lm = location_markers;
location_markers.clear ();
_sorted_marker_lists.clear ();
for (auto const & [l, m] : lm ) {
delete m;
}
}
void