diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-21 22:28:41 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-02-18 00:41:34 +0100 |
| commit | f9539b1dd582e8a57e3437758c63b22db3c844a4 (patch) | |
| tree | b653d9939beae796185a82bdd85ed56d2fc2c4da /src | |
| parent | a3047104cc984954eeb854c18247d7ce3bf82508 (diff) | |
Use a ScopeGuard to manage _loading_analysis properly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/text_panel.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc index 630ca6944..1d2c86631 100644 --- 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 (); } |
