diff options
author | Carl Hetherington <carl@carlh.net> | 2010-11-14 23:47:09 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-11-14 23:47:09 +0000 |
commit | a19e79f4f07a65b6fe6b5069ab4a88d14e29e21e (patch) | |
tree | 80b59f67c9b94aba79ac94579ec7f74e88e43228 /gtk2_ardour/editor_markers.cc | |
parent | b55ef985f59b8cc9e0b2aca9917bb605bcb39812 (diff) |
Fix crashes after removing markers.
git-svn-id: svn://localhost/ardour2/branches/3.0@8039 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 3f9c65a4c2..78c1edb8b0 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -55,6 +55,7 @@ Editor::clear_marker_display () } location_markers.clear (); + _sorted_marker_lists.clear (); } void @@ -495,6 +496,12 @@ Editor::refresh_location_display_internal (Locations::LocationList& locations) ++tmp; if (!i->second->valid) { + + remove_sorted_marker (i->second->start); + if (i->second->end) { + remove_sorted_marker (i->second->end); + } + delete i->second; location_markers.erase (i); } @@ -699,8 +706,15 @@ Editor::location_gone (Location *location) } for (i = location_markers.begin(); i != location_markers.end(); ++i) { - if ((*i).first == location) { - delete (*i).second; + if (i->first == location) { + + remove_sorted_marker (i->second->start); + if (i->second->end) { + remove_sorted_marker (i->second->end); + } + + + delete i->second; location_markers.erase (i); break; } @@ -1496,3 +1510,11 @@ Editor::toggle_marker_lines () i->second->set_show_lines (_show_marker_lines); } } + +void +Editor::remove_sorted_marker (Marker* m) +{ + for (std::map<ArdourCanvas::Group *, std::list<Marker *> >::iterator i = _sorted_marker_lists.begin(); i != _sorted_marker_lists.end(); ++i) { + i->second.remove (m); + } +} |