Пример #1
0
//void tl_process_kill_list(tl_class_list *x){
void tl_process_kill_list(tl_class *x){
  tl_class *dummy = x;
  tl_class *y = x;
  if(x!=NULL)
    {
      x = x->next; // the class list head is empty
      while(x!=NULL) // proceed as long as we have classes to kill
	{

	  // kill the module with its special kill function
	  x->kill_func(x->mod);
	  // save the class
	  dummy = x;
	  // progress to the next class
	  x=x->next;
	  // kill the dead class
	  kill_class (dummy);

	}
      // kill the class head
      kill_class(y);
    }
  else printf("error: process_kill_list: kill list is null\n");

}
Пример #2
0
void
classes_deinit(void)
{
  if ( rt_database != NULL )
  {
    qfree(rt_database);
    rt_database = NULL;
  }
  if ( NULL != CObject )
  {
    kill_class(CObject);
    CObject = NULL;
  }
  if ( NULL != misc_buffer1 )
  {
    qfree(misc_buffer1);
    misc_buffer1 = NULL;
  }
  if ( NULL != misc_buffer2 )
  {
    qfree(misc_buffer2);
    misc_buffer2 = NULL;
  }
  total_classes = 0;
  max_size = 0;
}
Пример #3
0
void 
kill_class(struct RP_class *root)
{
  int i;
  if ( NULL == root )
   return;
  if ( root->children != NULL && root->total )
   for ( i = 0; i < root->total; i++ )
    kill_class(root->children[i]);
  if ( root->children != NULL )
   qfree(root->children);
  qfree(root);
}