> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Ross Boylan
> Sent: Friday, August 20, 2004 11:35 AM
> To: r-help
> Subject: [R] Error messages and C
> 
> I am calling a C (C++ really) function via the .C interface.
> Sometimes when things go wrong I want to return an error message.
> 
> 1.  R provides C functions error and warning which look about right. 
> But exactly how does this exit, and in particular what 
> happens with cleaning up, calling C++ destructors, and 
> unwinding the stack?  Will I get memory leaks?
> 

I've run across this issue and I couldn't find a satisfactory solution
to the problem. error() is effectively a long jump. Moreover, if your
C++ function calls an R API function, e.g allocVector(), and the latter
calls error() ... you already know what will happen. Same for
interrupts.

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to