mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
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:
parent
95949e6267
commit
e26edc93d6
1 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue