Main Content

Terminate

Free all resources allocated byMATLABRuntimeinstance associated withlibrary

Synopsis

voidlibraryTerminate(void)

Description

This function frees all resources allocated by theMATLAB®Runtimeinstance associated withlibrary. Call this function after you finish calling the functions in this generated library and before callingmclTerminateApplication.

Examples

CalllibmatrixInitializeto initializelibmatrixlibrary properly near the start of your program:

/* Call the library initialization routine and ensure the * library was initialized properly. */ if (!libmatrixInitialize()) { fprintf(stderr, "An error occurred while initializing: \n %s ", mclGetLastErrorMessage()); return -2; } else ...

Near the end of your program (but before callingmclTerminateApplication), free resources allocated by theMATLAB Runtimeinstance associated with thelibmatrixlibrary:

/* Call the library termination routine */ libmatrixTerminate(); /* Free the memory created */ mxDestroyArray(in1); in1=0; mxDestroyArray(in2); in2 = 0; }

Version History

Introduced in R2015a