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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user