Fix crash when removing multiple cinemas caused by _selected_cinemas being changed...
authorCarl Hetherington <cth@carlh.net>
Tue, 17 Oct 2023 23:03:55 +0000 (01:03 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 17 Oct 2023 23:03:55 +0000 (01:03 +0200)
src/wx/screens_panel.cc

index 9d322e45e0d496ebaa9b46432b45625b5bfdd9b0..99f0d8ef0ddcb808b2f4e5399e2ebde99b36e3f3 100644 (file)
@@ -330,7 +330,9 @@ ScreensPanel::remove_cinema_clicked ()
                }
        }
 
-       for (auto const& cinema: _selected_cinemas) {
+       auto cinemas_to_remove = _selected_cinemas;
+
+       for (auto const& cinema: cinemas_to_remove) {
                _ignore_cinemas_changed = true;
                ScopeGuard sg = [this]() { _ignore_cinemas_changed = false; };
                for (auto screen: cinema->screens()) {