Skip to content
Prev 24055 / 63424 Next

R/C++/memory leaks

On Tue, 27 Feb 2007, Ernest Turro wrote:

            
Unfortunately we can't leave those aside.  If standard unix where
interrupts arrive as signals is all you care about then you can just
save, replace and restore the R SIGINT handler around your code with
one that sets a flag of your own.  Things are not so simple on GUI
systems where detecting a user interrupt action requires event
processing, which might result in errors and non-local exits in
response to those.

There is an internal mechanism for registering C level on.exit
routines but this is not in a form that can be made public as it would
tie down implementation decisions too much.  It is principle possible
to build something around R_ToplevelExec, but that is not at this
point part of the public API and so is subject to change.  We might
consider providing a variant of R_CheckInterrupts that either just
checks or that executes cleanup code sometime after 2.5 is released.

Best,

luke