MLReleaseParameters (C 函数)

MLReleaseParameters 已经被 WSReleaseParameters 所取代.

void MLReleaseParameters( MLEnvironmentParameter e )

releases memory allocated by MLNewParameters() and stored in e.

更多信息

  • The environment parameter object e must have been created by a call to MLNewParameters().
  • MLReleaseParameters() is declared in the MathLink header file mathlink.h.

范例

基本范例  (1)

#include "mathlink.h"

void * Alloc(unsigned long l)
{
    /* ... */
}

void Free(void *m)
{
    /* ... */
}


int main()
{
    MLEnvironmentParameter ep;
    MLENV env;

    ep = MLNewParameters(MLREVISION, MLAPIREVISION);
    if(ep == (MLEnvironmentParameter)0)
    { /* Unable to create a new environment parameter object */ }

    MLSetAllocParameter(ep, Alloc, Free);

    env = MLInitialize(ep);
    if(env == (MLENV)0)
    { /* Unable to initialize environment object */ }

    MLReleaseParameters(ep);

    /* ... */

    MLDeinitialize(env);

    return 0;
}