cleanup

이 메소드는 RiCOSTask 오브젝트 삭제 후 메모리를 정리합니다.

시그니처
void RiCOSTask_cleanup (RiCOSTask *const me);
매개변수
me

이후에 정리할 RiCOSTask 오브젝트입니다.

예제
void RiCOSTask_cleanup(RiCOSTask * const me)
{
   if (me == NULL) return;

   if (!me->isWrapperThread) {
      RiCOSEventFlag_cleanup(&me->m_SuspEventFlag);
      /* Remove the thread. */
      if (me->endOSTaskInCleanup) {
         RiCBoolean onMyTask = RiCOSTask_exeOnMyTask(me);
         if (!((RiCOSTask_endOfProcess) &&
            RiCOSTask_exeOnMyTask(me))) {
            /* Do not kill the OS thread if this is the 
               end of process and the running thread 
               is 'this' - you need the OS thread to do
               some cleanup, and then you kill it
               explicitly. */
            RiCOSTaskEndCallBack theOSTaskEndClb = NULL;
            void * arg1 = NULL;
            /* Get a callback function to end the OS
               thread. */
            (void)RiCOSTask_getTaskEndClbk(me,
               &theOSTaskEndClb, &arg1, onMyTask);
            if (theOSTaskEndClb != NULL) {
               /* End the OS thread */
               (*theOSTaskEndClb)(arg1);
            }
         }
      }
   }
}

피드백