diff libinterp/corefcn/mex.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 27ef5f83682c
children bbff46267cad
line wrap: on
line diff
--- a/libinterp/corefcn/mex.cc	Wed Sep 30 08:59:11 2020 +0200
+++ b/libinterp/corefcn/mex.cc	Wed Sep 30 03:17:52 2020 -0700
@@ -4250,10 +4250,8 @@
   for (int i = 0; i < nout; i++)
     argout[i] = nullptr;
 
-  octave::unwind_protect_safe frame;
-
   // Save old mex pointer.
-  frame.protect_var (mex_context);
+  octave::unwind_protect_var<mex *> restore_var (mex_context);
 
   mex context (mex_fcn);