Function _conRelease() Foundation

Releases the memory space of a container which is no longer needed.

Syntax
XPPAPIRET _conRelease(ContainerHandle ch);
Parameters
ContainerHandle ch
Handle of any container.
Return

The function returns an error code (XPP_ERR_...) when the passed container handle could not be released. If the return value is NULL the operation was successful.

Description

The function _conRelease() releases the memory space of container objects. It must be called for each container which is created with the container API. New containers can be created not only from the _conNew...() functions, but also from the _conPut...() functions and from _conArrayGet(). The release of a container handle produces only one error: when the passed value is not a container handle of an existing container. After its release the container handle can no longer be used.

The function _conParam() does not create a new container for reference parameters. Therefore if pbRef is used you have to check that the parameter is not passed by reference before you call _conRelease().

Examples
/* 
Creates array with 10 elements and assigns the numerical value 42 to 
the 10th element. 
*/ 
#include "xppcon.h" 


XPPAPIRET       xr; 
ContainerHandle hArray, 
             hValue; 


hArray = _conNewArray(1, 10); 

if (hArray != NULLCONTAINER) 
{ 
/* Produces numeric container */ 
hValue = _conPutNL(NULLCONTAINER, 42); 

xr = _conArrayPut(hArray, hValue, 10, 0); 
if (xr != 0) 
{ 
   /* ... error handling */ 
} 
/* ... */ 

if (hValue != NULLCONTAINER) 
   _conRelease(hValue); 

_conRelease(hArray); 
} 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.