Function _conRelease() Foundation
Releases the memory space of a container which is no longer needed.
XPPAPIRET _conRelease(ContainerHandle ch);
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.
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.
/*
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);
}
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.