cleanup

cleanup 方法用于在销毁 RiCOSConnectionPort 对象后进行清除。

特征符
void RiCOSConnectionPort_cleanup(
   RiCOSConnectionPort * const me);
参数
me

这是完成操作后要清除的对象

示例
void 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;
}

反馈