% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ergm_state.R
\name{ergm_Cstate_clear}
\alias{ergm_Cstate_clear}
\title{Deallocate the C data structures corresponding to an \code{\link{ergm_state}} left over from a \code{\link[=.Call]{.Call()}} run.}
\usage{
ergm_Cstate_clear()
}
\description{
This function is exported for use by other packages that use the \code{ErgmState} C API. It should be used as a part of an \code{\link[=on.exit]{on.exit()}} call in the function that calls the C routine if the C routine contains \code{R_CheckUserInterrupt()} calls, in order to ensure that memory is freed if the routine is interrupted.
}
\examples{
\dontrun{
long_run <- function(...){
  on.exit(ergm_Cstate_clear())
  .Call("long_run",...)
}
}

}
\seealso{
\code{\link{ergm_state}}
}
\keyword{internal}
