Mercurial > octave
diff libinterp/corefcn/interpreter.cc @ 29545:841ca9987302 stable
perform shutdown actions in interpreter destructor (bug #60334)
* interpreter.cc (interpreter::~interpreter): Call shutdown.
(interpreter::shutdown): Return immediately if m_initialized is
false and set m_initialized to false to prevent shutdown from being
executed recursively.
* embedded.cc (main): Don't call shutdown for interpreter object.
* octave.cc (cli_application::execute): Likewise.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Apr 2021 16:20:10 -0400 |
parents | 0a5b15007766 |
children | 58e1230b9503 78cb255c78a4 |
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter.cc Wed Apr 14 15:03:09 2021 +0200 +++ b/libinterp/corefcn/interpreter.cc Tue Apr 20 16:20:10 2021 -0400 @@ -635,6 +635,8 @@ interpreter::~interpreter (void) { + shutdown (); + delete m_gh_manager; } @@ -845,6 +847,13 @@ void interpreter::shutdown (void) { + // Attempt to prevent more than one call to shutdown. + + if (! m_initialized) + return; + + m_initialized = false; + OCTAVE_SAFE_CALL (feval, ("close", ovl ("all"), 0)); // If we are attached to a GUI, process pending events and