octave-maintainers
[Top][All Lists]
Advanced

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

Patch to Octave shutdown procedures


From: John Swensen
Subject: Patch to Octave shutdown procedures
Date: Mon, 18 May 2009 15:27:12 -0400

As I have been working on OctaveDE, I have found that the way Octave currently shuts down has made me jump through hoops to get the shutdown sequence right. Because the clean_up_and_exit() function directly calls exit() and because I am interacting with octave via a different thread, I have had serious issues with variables becoming invalid in the middle of an operation. I propose the following patch (or something similar) to allow an IDE to clean up Octave on its own. The patch simply provides two additional flags: 1) ide_embedded: allows a user to flag and instance of octave as being embedded in an IDE. This flags makes it so clean_up_and_exit only sets the do_exit_readline_loop flag 2) do_exit_readline_loop: this flags causes the main_loop which calls readline to exit and do nothing else

Then, in my IDE, after I have stopped all the threads that are interacting with Octave and am sure that the readline idle event loop is also no longer running, I call do_octave_atexit() myself to clean things up. Maybe you would like a different format or manner of handling this, but at this point it is somewhat of a necessity for me to create a robust IDE using VTE in which the Octave process is simply embedded in a terminal window in my application. I have spent a lot of time trying workarounds and the only other viable option it to issue a full KILL signal to Octave running in VTE, which seems ugly and unnecessary and doesn't work for Windows. This patch would work for both Windows, Linux, and OSX.

John Swensen

Attachment: ide_embedded_changeset.patch
Description: Binary data





reply via email to

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