This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MathLink C Function

MLReleaseByteArray()

void MLReleaseByteArray(MLINK link, unsigned char *a, int *dims, char **heads, int d)
disowns the memory allocated by MLGetByteArray() to store the array a, its dimensions dims and the heads heads.
  • MLReleaseByteArray() is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

/* read an array of integers each of size 1 byte and then release that memory to MathLink for deallocation */

void f(MLINK lp)
{
    unsigned char *data;
    int *dimensions;
    char **heads;
    int depth;

    if(! MLGetByteArray(lp, &data, &dimensions, &heads, &depth))
        { /* unable to read array from lp */ }

    /* ... */

    MLReleaseByteArray(lp, data, dimensions, heads, depth);
}