WSReleaseUCS2String()
This feature is not supported on the Wolfram Cloud.

void WSReleaseUCS2String(WSLINK link,unsigned short *s,int n)
disowns memory allocated by WSGetUCS2String() to store the string s.

DetailsDetails

  • WSReleaseUCS2String() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* read a UCS-2 encoding string from a link and then release the memory to WSTP for deallocation */

void f(WSINK lp)
{
    unsigned short *string;
    int length;

    if(! WSGetUCS2String(lp, &string, &length))
        { /* unable to read the UCS-2 string */ }

    /* ... */

    WSReleaseUCS2String(lp, string, length);
}