Skip to content
Prev 37901 / 63424 Next

checking user interrupts in C(++) code

On Sep 29, 2010, at 11:34 AM, Berwin A Turlach wrote:

            
Any R objects are just fine because the protection stack gets unwound during cleanup. The whole point of PROTECT is that it protects the object for the duration of the call. On a clean exit you're responsible for the UNPROTECTing, for error handling exit R is responsible.
Nope, R_CheckInterrupt is just like any other R function - it may never return - but if it doesn't it cleans up everything R-related properly. The above R-ext note just tells you that your own stuff will need cleaning. R_CheckInterrupt is not really special in any way - for all practical purposes it behaves just like any other R API call and the same rules apply.

Cheers,
Simon