# HG changeset patch # User John W. Eaton # Date 1614706363 18000 # Tue Mar 02 12:32:43 2021 -0500 # Branch stable # Node ID fc4798f8c0f3c7afebcb5b24c60958f7a667c421 # Parent ce425b657693d02c2a11a5fc7f0ca87e12d8f5a1 defer clearing function vars until stack frame is deleted (bug #60137) * pt-eval.cc (tree_evaluator::execute_user_function): Don't use unwind_action object to clear local variables; they will be deleted when the containing stack frame is deleted. diff --git a/libinterp/parse-tree/pt-eval.cc b/libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc +++ b/libinterp/parse-tree/pt-eval.cc @@ -2740,11 +2740,6 @@ namespace octave unwind_protect_var upv (m_statement_context, SC_FUNCTION); - unwind_action act1 ([] (std::shared_ptr frame) - { - frame->clear_values (); - }, m_call_stack.get_current_stack_frame ()); - { profiler::enter block (m_profiler, user_function);