changeset 28623:7bdd127d77e5

maint: merge stable to default.
author John W. Eaton <jwe@octave.org>
date Sat, 15 Aug 2020 23:41:26 -0400
parents 174dc4519e73 (current diff) d075c2f26d1d (diff)
children aae9d7f098bd
files libinterp/corefcn/interpreter.cc
diffstat 1 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter.cc	Fri Aug 14 14:15:50 2020 -0700
+++ b/libinterp/corefcn/interpreter.cc	Sat Aug 15 23:41:26 2020 -0400
@@ -872,7 +872,11 @@
 
     // Clear all functions and variables.
 
-    OCTAVE_SAFE_CALL (clear_all, (true));
+    // Note that we don't force symbols to be cleared, so we will
+    // respect mlock at this point.  Later, we'll force all variables
+    // and functions to be cleared.
+
+    OCTAVE_SAFE_CALL (clear_all, ());
 
     // We may still have some figures.  Close them.
 
@@ -885,7 +889,11 @@
     // endless.  At some point, we have to give up and force execution
     // to end.
 
-    OCTAVE_SAFE_CALL (clear_all, (true));
+    // Note that we again don't force symbols to be cleared, so we
+    // continue to respect mlock here.  Later, we'll force all variables
+    // and functions to be cleared.
+
+    OCTAVE_SAFE_CALL (clear_all, ());
 
     // Do this explicitly so that destructors for mex file objects
     // are called, so that functions registered with mexAtExit are
@@ -900,6 +908,13 @@
     if (! command_history::ignoring_entries ())
       OCTAVE_SAFE_CALL (command_history::clean_up_and_save, ());
 
+    OCTAVE_SAFE_CALL (m_gtk_manager.unload_all_toolkits, ());
+
+    // Now that the graphics toolkits have been unloaded, force all
+    // symbols to be cleared.
+
+    OCTAVE_SAFE_CALL (clear_all, (true));
+
     // FIXME:  May still need something like this to ensure that
     // destructors for class objects will run properly.  Should that be
     // done earlier?  Before or after atexit functions are executed?
@@ -908,8 +923,6 @@
 
     OCTAVE_SAFE_CALL (m_symbol_table.cleanup, ());
 
-    OCTAVE_SAFE_CALL (m_gtk_manager.unload_all_toolkits, ());
-
     OCTAVE_SAFE_CALL (sysdep_cleanup, ());
 
     OCTAVE_SAFE_CALL (flush_stdout, ());