octave-maintainers
[Top][All Lists]
Advanced

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

PATCH for Re: exiting embedded mode gracefully


From: Matt Flax
Subject: PATCH for Re: exiting embedded mode gracefully
Date: Mon, 9 May 2016 16:40:03 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

Hi there,

I have attached a patch which makes it possible to cleanup octave without exiting the process.
It is pretty simple, just exposed the function do_octave_atexit for linking.

This allows the exiting of octave without killing the process or sleeping for days ! As it just exposes the function for linking against, it doesn't alter the inner workings of the current exit methodology.

Thanks for all the good work.
Matt
p.s. was created against 4.0.1, however seems to patch trunk ok.

On 07/05/16 16:33, Matt Flax wrote:
Hi there,

I am having a problem, would like some help with please.

When I start octave, it is the usual mechanism (as shown here https://www.gnu.org/software/octave/doc/v4.0.1/Standalone-Programs.html):

octave_main((int)argsIn.size(), (char**)&argsIn[0], embedded);

When I exit octave in the usual manner ( clean_up_and_exit(0)) I get a complete exit ... i.e. the whole process seems to end ... without continuing the thread execution through the C++ destructors in my code base ... for example :

clean_up_and_exit(0)
cout<<"this doesn't get printed !"<<endl;

If I set safe to return (rather then sleeping = clean_up_and_exit(0, true)) the thread still ends prematurely !

If I don't execute the "clean_up_and_exit" function, then I get a segmentation fault.

Any ideas what to change in the process to get an exit with the completion of the thread ?

thanks
Matt


Attachment: octave-clean-no-exit.patch
Description: Text Data


reply via email to

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