projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41467eb
)
Use a ScopeGuard to manage _loading_analysis properly.
author
Carl Hetherington
<cth@carlh.net>
Sat, 21 Jan 2023 21:28:41 +0000
(22:28 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Mon, 27 Feb 2023 13:47:25 +0000
(14:47 +0100)
src/wx/text_panel.cc
patch
|
blob
|
history
diff --git
a/src/wx/text_panel.cc
b/src/wx/text_panel.cc
index 630ca6944e3da2ced3b33b502cd0dd96427331c6..1d2c8663135f748a34403d1d8c80aaeeab3162fd 100644
(file)
--- a/
src/wx/text_panel.cc
+++ b/
src/wx/text_panel.cc
@@
-809,13
+809,16
@@
TextPanel::try_to_load_analysis ()
}
_loading_analysis = true;
+ ScopeGuard sg = [this]() {
+ _loading_analysis = false;
+ setup_sensitivity();
+ };
+
setup_sensitivity ();
_analysis.reset ();
auto content = _analysis_content.lock ();
if (!content) {
- _loading_analysis = false;
- setup_sensitivity ();
return;
}
@@
-845,8
+848,6
@@
TextPanel::try_to_load_analysis ()
}
update_outline_subtitles_in_viewer ();
- _loading_analysis = false;
- setup_sensitivity ();
}