예제 #1
0
파일: etam_packets.c 프로젝트: Limsik/e17
void
etam_packets_free(Etam_Packets *packets)
{
   unsigned int i;
   unsigned short j;

   if (EINA_REFCOUNT_GET(packets))
     return ;

   eina_rwlock_free(&packets->lock);

   switch (packets->type)
     {
      case ETAM_T_BOOLEAN:
         for (i = 0; i < packets->packets_count; ++i)
           free(packets->u.boolean[i].rle_value);
         free(packets->u.boolean);
         break;
      case ETAM_T_LONG_LONG:
         for (i = 0; i < packets->packets_count; ++i)
           free(packets->u.long_long[i]);
         free(packets->u.long_long);
         break;
      case ETAM_T_STRING:
         /* It is assumed that all string are coming from Eet dictionnary, none have been directly inserted */
         for (i = 0; i < packets->packets_count; ++i)
           free(packets->u.string);
         free(packets->u.string);
         break;
      case ETAM_G_STRINGS:
         for (i = 0; i < packets->packets_count; ++i)
	   if (packets->u.strings[i])
	     for (j = 0; j < 1024; ++j)
	       eina_list_free(packets->u.strings[i]->values[j]);
         free(packets->u.strings);
         break;

      case ETAM_T_NONE:
      case ETAM_T_CHAR:
      case ETAM_T_UCHAR:
      case ETAM_T_SHORT:
      case ETAM_T_USHORT:
      case ETAM_T_INT:
      case ETAM_T_UINT:
      case ETAM_T_ULONG_LONG:
      case ETAM_T_FLOAT:
      case ETAM_T_DOUBLE:
      case ETAM_T_F32P32:
      case ETAM_T_F16P16:
      case ETAM_T_F8P24:
      case ETAM_T_NULL:
      case ETAM_T_RECTANGLE:
      case ETAM_G_RECTANGLES:
      case ETAM_G_TAGGED_RECTANGLES:
      default:
         fprintf(stderr, "Destruction of packet type %i impossible\n", packets->type);
     }

   free(packets);
}
예제 #2
0
파일: eio_monitor.c 프로젝트: jigpu/efl
static void
_eio_monitor_stat_cb(void *data, EINA_UNUSED Eio_File *handler, EINA_UNUSED const Eina_Stat *st)
{
   Eio_Monitor *monitor = data;

   monitor->exist = NULL;

   if (EINA_REFCOUNT_GET(monitor) > 1)
     eio_monitor_backend_add(monitor);

   EINA_REFCOUNT_UNREF(monitor)
     _eio_monitor_free(monitor);
}