octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60334] Embedded Octave crashes on exit in oct


From: Rik
Subject: [Octave-bug-tracker] [bug #60334] Embedded Octave crashes on exit in octave::interpreter::~interpreter()
Date: Thu, 8 Apr 2021 10:54:39 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36

Follow-up Comment #10, bug #60334 (project octave):

Summarizing what I understand from comment #9, there are another two possible
paths to resolution

1) Change documentation to note that interpreter.shutdown () *must* be called
for embedded interpreters.

Incidentally, the example code that Octave distributes for this use case is
the file embedded.cc and the final lines of that file are


  // Shutdown the interpreter which cleanly releases all memory.
  interpreter.shutdown ();
 

So, if users just copy&paste the sample code and then build from there this
will work.

2) Add interpreter.shutdown () to the destructor for an intrepreter object.

Off hand, this would seem to conform more to programmer's expectations.  An
interpreter object is created easily with


octave::interpreter interpreter;


and a programmer would normally expect that when an object goes out of scope
it naturally takes care of cleaning itself up.  Just to push the point, if I
write


std::string mystring ("Hello World");


I don't expect to have to write 


mystring.clear ();


at the bottom of the function that instantiates the variable.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60334>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]