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;
}

피드백