diff libinterp/corefcn/error.cc @ 28823:26cfccfee9a0

Replace unwind_protect with more efficient constructs (bug #59192). * debug.cc, error.cc, ft-text-renderer.cc, load-path.cc, mex.cc, oct-hist.cc, pager.cc, rand.cc, strfns.cc, sysdep.cc, toplev.cc, variables.cc, __delaunayn__.cc, __voronoi__.cc, audiodevinfo.cc, audioread.cc, convhulln.cc, ov-class.cc, ov-struct.cc: Remove unwind_protect frames declared but never used. Replace frame.protect_var () instances with unwind_protect_var<> object. Replace frame.add_fcn () instances with unwind_action<> object.
author Rik <rik@octave.org>
date Wed, 30 Sep 2020 03:17:52 -0700
parents 810eb29fc227
children 43ad651cf5a0
line wrap: on
line diff
--- a/libinterp/corefcn/error.cc	Wed Sep 30 08:59:11 2020 +0200
+++ b/libinterp/corefcn/error.cc	Wed Sep 30 03:17:52 2020 -0700
@@ -571,10 +571,7 @@
          || application::forced_interactive ())
         && debug_on_warning () && in_user_code && bptab.debug_on_warn (id))
       {
-        unwind_protect frame;
-
-        frame.protect_var (m_debug_on_warning);
-        m_debug_on_warning = false;
+        unwind_protect_var<bool> restore_var (m_debug_on_warning, false);
 
         tw.enter_debugger ();
       }