[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New function: remove_atexit
From: |
John W. Eaton |
Subject: |
Re: New function: remove_atexit |
Date: |
Thu, 31 May 2007 15:34:32 -0400 |
On 29-May-2007, Michael Goffioul wrote:
| On 5/29/07, David Bateman <address@hidden> wrote:
| > Thinking about it, it might be better to include this in atexit and use
| > a second boolean argument to define that atexit is supposed to remove
| > the function. That is "axexit (func, true)" (the default) to add a
| > function and "atexit (func, false)" to remove it... Also there is a typo
| > in the help string : Seacrch -> Search
|
| What about this one?
Instead of using a temporary stack, I think it would be better to
change the type of octave_atexit_functions to be a list so we can use
iterators to traverse the list and the erase method to remove an item.
| Michael.
| Index: src/toplev.cc
| ===================================================================
| RCS file: /cvs/octave/src/toplev.cc,v
| retrieving revision 1.198
| diff -c -p -r1.198 toplev.cc
| *** src/toplev.cc 14 May 2007 17:35:46 -0000 1.198
| --- src/toplev.cc 29 May 2007 13:07:58 -0000
| *************** variable @code{status} to the integer @s
| *** 558,564 ****
| ZeroMemory (&si, sizeof (si));
| ZeroMemory (&pi, sizeof (pi));
| OCTAVE_LOCAL_BUFFER (char, xcmd_str, cmd_str.length()+1);
| ! strcpy (xcmd_str, cmd_str.c_str ())
|
| if (! CreateProcess (0, xcmd_str, 0, 0, FALSE, 0, 0, 0, &si,
&pi))
| error ("system: CreateProcess failed -- can't create child
process");
| --- 558,564 ----
| ZeroMemory (&si, sizeof (si));
| ZeroMemory (&pi, sizeof (pi));
| OCTAVE_LOCAL_BUFFER (char, xcmd_str, cmd_str.length()+1);
| ! strcpy (xcmd_str, cmd_str.c_str ());
|
| if (! CreateProcess (0, xcmd_str, 0, 0, FALSE, 0, 0, 0, &si,
&pi))
| error ("system: CreateProcess failed -- can't create child
process");
I applied this patch to toplev.cc.
Thanks,
jwe