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);
   
   /* 假設您只有一個連接埠
      因此可以釋放 m_Buf 的資料;如果不是
      這樣的情況,readFromSockLoop 會對其進行配置。*/
   if (me->m_Buf) {
      free(me->m_Buf);
   }
   me->m_BufSize = 0;
}

意見回饋