delete all views matching the given criteria, skipping the first "start" views * */
| 731 | /* delete all views matching the given criteria, skipping the first "start" views |
| 732 | * */ |
| 733 | void cleanup_views(std::function<bool(SwitcherView&)> criteria) |
| 734 | { |
| 735 | auto it = views.begin(); |
| 736 | while (it != views.end()) |
| 737 | { |
| 738 | if (criteria(*it)) |
| 739 | { |
| 740 | it = views.erase(it); |
| 741 | } else |
| 742 | { |
| 743 | ++it; |
| 744 | } |
| 745 | } |
| 746 | } |
| 747 | |
| 748 | /* Removes all expired views from the list */ |
| 749 | void cleanup_expired() |