summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wx/content_panel.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index fd1315747..77607ad16 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -817,14 +817,16 @@ ContentPanel::set_selection (weak_ptr<Content> wc)
void
ContentPanel::set_selection (ContentList cl)
{
- _no_check_selection = true;
+ {
+ _no_check_selection = true;
+ ScopeGuard sg = [this]() { _no_check_selection = false; };
- auto content = _film->content ();
- for (size_t i = 0; i < content.size(); ++i) {
- set_selected_state(i, find(cl.begin(), cl.end(), content[i]) != cl.end());
+ auto content = _film->content ();
+ for (size_t i = 0; i < content.size(); ++i) {
+ set_selected_state(i, find(cl.begin(), cl.end(), content[i]) != cl.end());
+ }
}
- _no_check_selection = false;
check_selection ();
}