mclTerminateApplication

Close MATLAB Runtime-internal application state

Synopsis

bool mclTerminateApplication(void)

Description

Call this function once at the end of your program to close MATLAB® Runtime-internal application state. Call only once per process. After you have called this function, you cannot call any further MATLAB Compiler SDK™-generated functions or any functions in any MATLAB library.

    Caution   mclTerminateApplication must be called once only per process. Calling mclTerminateApplication more than once may cause your application to exhibit unpredictable or undesirable behavior.

    Caution   mclTerminateApplication will close any visible or invisible figures before exiting. If you have visible figures that you would like to wait for, use mclWaitForFiguresToDie.

Examples

At the start of your program, call mclInitializeApplication to ensure your library was properly initialized:

mclInitializeApplication(NULL,0);
if (!libmatrixInitialize()){
    fprintf(stderr, 
            "An error occurred while initializing: \n %s ",
            mclGetLastErrorMessage());
    return -1;
}

At your program's exit point, call mclTerminateApplication to properly shut the application down:

mxDestroyArray(in1); in1=0;
mxDestroyArray(in2); in2 = 0;
mclTerminateApplication();
return 0;
Was this topic helpful?