ergm_Cstate_clear: Deallocate the C data structures corresponding to an...

View source: R/ergm_state.R

ergm_Cstate_clearR Documentation

Deallocate the C data structures corresponding to an ergm_state left over from a .Call() run.

Description

This function is exported for use by other packages that use the ErgmState C API. It should be used as a part of an on.exit() call in the function that calls the C routine if the C routine contains R_CheckUserInterrupt() calls, in order to ensure that memory is freed if the routine is interrupted.

Usage

ergm_Cstate_clear()

See Also

ergm_state

Examples

## Not run: 
long_run <- function(...){
  on.exit(ergm_Cstate_clear())
  .Call("long_run",...)
}

## End(Not run)


statnet/ergm documentation built on April 17, 2024, 12:21 p.m.