changeset 30737:7ee1ec5753c1

maint: Merge stable to default.
author John W. Eaton <jwe@octave.org>
date Sat, 12 Feb 2022 14:20:07 -0500
parents 4335606e41ac (current diff) dadbfe6fddd6 (diff)
children e022eab3ea1b
files libinterp/corefcn/interpreter.cc libinterp/corefcn/interpreter.h
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter.cc	Thu Feb 10 09:17:46 2022 +0100
+++ b/libinterp/corefcn/interpreter.cc	Sat Feb 12 14:20:07 2022 -0500
@@ -653,8 +653,6 @@
 
   interpreter::~interpreter (void)
   {
-    shutdown ();
-
     delete m_gh_manager;
   }
 
@@ -853,7 +851,11 @@
                   exit_status = status;
 
                 if (! options.persist ())
-                  return exit_status;
+                  {
+                    shutdown ();
+
+                    return exit_status;
+                  }
               }
 
             // If there is an extra argument, see if it names a file to
@@ -868,7 +870,11 @@
                   exit_status = status;
 
                 if (! options.persist ())
-                  return exit_status;
+                  {
+                    shutdown ();
+
+                    return exit_status;
+                  }
               }
 
             if (options.forced_interactive ())
@@ -906,6 +912,8 @@
         exit_status = xe.exit_status ();
       }
 
+    shutdown ();
+
     return exit_status;
   }
 
--- a/libinterp/corefcn/interpreter.h	Thu Feb 10 09:17:46 2022 +0100
+++ b/libinterp/corefcn/interpreter.h	Sat Feb 12 14:20:07 2022 -0500
@@ -166,8 +166,6 @@
 
     int execute (void);
 
-    void shutdown (void);
-
     bool server_mode (void) const { return m_evaluator.server_mode (); }
 
     bool interactive (void) const
@@ -554,6 +552,8 @@
 
     int server_loop (void);
 
+    void shutdown (void);
+
     void execute_atexit_fcns (void);
 
     void maximum_braindamage (void);