WSReleaseString (C Function)

void WSReleaseString(WSLINK link,const char *s)

disowns memory allocated by WSGetString() to store the character string s.

Details

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

Examples

Basic Examples  (1)

#include "wstp.h"

/* read a C string from a link and then release that memory to WSTP for deallocation */

void f(WSLINK lp)
{
    const char *s;

    if(! WSGetString(lp, &s))
        { /* unable to read the string from lp */ }

/* ... */

    WSReleaseString(lp, s);
}