Register a function to be called on shutdown.
#include "mex.h"
int mexAtExit(ExitFcn)
void (*ExitFcn)();
integer*4 function mexAtExit(ExitFcn)
subroutine ExitFcn()
ExitFcn
- pointer to a function
This routine allows you to register a C function to be called just before the MEX-file is cleared or MATLAB is terminated. It provides your MEX-file with a chance to perform an orderly shutdown of anything under its control. A nonzero value is returned if the registration fails. Only one function can be registered per MEX-file.
Declare the ExitFcn
as external
in the Fortran routine that calls mexAtExit
.
(c) Copyright 1994 by The MathWorks, Inc.