From: Carl Hetherington Date: Sun, 19 Nov 2023 23:14:32 +0000 (+0100) Subject: Cleanup: use ScopeGuard. X-Git-Tag: v2.16.67~6 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=ff5ed87ed6730b62e037991cbd4a6b5ee43dd7cb Cleanup: use ScopeGuard. --- diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 5dd0a0afe..6c6e756ec 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -706,10 +706,12 @@ private: DCPOMATIC_ASSERT (dcp); try { if (dcp) { + ScopeGuard sg([this]() { + _viewer.set_coalesce_player_changes(false); + }); _viewer.set_coalesce_player_changes(true); dcp->add_kdm (dcp::EncryptedKDM(dcp::file_to_string(wx_to_std(d->GetPath()), MAX_KDM_SIZE))); examine_content(); - _viewer.set_coalesce_player_changes(false); } } catch (exception& e) { error_dialog (this, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));