<library>Terminate

Free all resources allocated by MATLAB Runtime instance associated with library

Synopsis

void libraryTerminate(void) 

Description

This function should be called after you finish calling the functions in this generated library, but before mclTerminateApplication is called.

Examples

Call libmatrixInitialize to initialize libmatrix library properly near the start of your program:

/* Call the library intialization 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 calling mclTerminateApplication) free resources allocated by the MATLAB® Runtime instance associated with library libmatrix:

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