The cleanup method cleans
up after an RiCOSConnectionPort object is destroyed.
Signaturevoid RiCOSConnectionPort_cleanup(
RiCOSConnectionPort * const me);
Parametersme
The object to clean up
after
Examplevoid RiCOSConnectionPort_cleanup(
RiCOSConnectionPort * const me)
{
if (me==NULL) return;
RiCOSSocket_cleanup(&me->m_Socket);
/* Assumes you will have only one connection port
so the data for m_Buf can be freed; if it is not
the case, the readFromSockLoop will allocate it. */
if (me->m_Buf) {
free(me->m_Buf);
}
me->m_BufSize = 0;
}