mexAtExit

Purpose

Register a function to be called on shutdown.

C Synopsis

#include "mex.h"
int mexAtExit(ExitFcn)
  void (*ExitFcn)();

Fortran Synopsis

integer*4 function mexAtExit(ExitFcn)
subroutine ExitFcn()

Arguments

ExitFcn
pointer to a function

Description

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.