예제 #1
0
파일: efl_ui_pager.c 프로젝트: tasn/efl
EOLIAN static void
_efl_ui_pager_efl_object_invalidate(Eo *obj,
                                    Efl_Ui_Pager_Data *pd)
{
   efl_invalidate(efl_super(obj, MY_CLASS));

   /* Since the parent of foreclip and backclip is evas, foreclip and backclip
    * are not deleted automatically when pager is deleted.
    * Therefore, foreclip and backclip are deleted manually here. */
   efl_del(pd->foreclip);
   efl_del(pd->backclip);
}
예제 #2
0
EOLIAN static Efl_Object *
_efl_net_dialer_simple_efl_object_finalize(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
{
   if (efl_io_buffered_stream_inner_io_get(o)) goto end;

   if (!pd->inner_class)
     {
        ERR("no valid dialer was set with efl_io_buffered_stream_inner_io_set() and no class set with efl_net_dialer_simple_inner_class_set()!");
        return NULL;
     }
   else
     {
        Eo *dialer = efl_add(pd->inner_class, o);
        EINA_SAFETY_ON_NULL_RETURN_VAL(dialer, NULL);

        if (!efl_isa(dialer, EFL_NET_DIALER_INTERFACE))
          {
             ERR("class %s=%p doesn't implement Efl.Net.Dialer interface!", efl_class_name_get(pd->inner_class), pd->inner_class);
             efl_del(dialer);
             return NULL;
          }
        DBG("created new inner dialer %p (%s)", dialer, efl_class_name_get(efl_class_get(dialer)));

        efl_io_buffered_stream_inner_io_set(o, dialer);
     }

 end:
   return efl_finalize(efl_super(o, MY_CLASS));
}
예제 #3
0
파일: efl_ui_pager.c 프로젝트: tasn/efl
static void
_event_handler_del(Eo *obj, Efl_Ui_Pager_Data *pd)
{
   efl_content_unset(efl_part(obj, "efl.event"));
   efl_del(pd->event);
   pd->event = NULL;
}
예제 #4
0
void
_view_free(View_Common *common)
{
   if (common->monitor) efl_del(common->monitor);
   common->monitor = NULL;
   if (common->selection) eina_list_free(common->selection);
   common->selection = NULL;
   if (common->files) eina_hash_free(common->files);
   common->files = NULL;
}
예제 #5
0
static Eina_Bool
_ecore_con_local_win32_client_add(void *data, Ecore_Win32_Handler *wh)
{
   Ecore_Con_Server *obj = data;
   Efl_Network_Server_Data *svr = efl_data_scope_get(obj, EFL_NETWORK_SERVER_CLASS);
   Ecore_Win32_Handler *handler_read;
   Ecore_Win32_Handler *handler_peek;

   if (!svr->pipe)
     return ECORE_CALLBACK_CANCEL;

   if (svr->delete_me)
     return ECORE_CALLBACK_CANCEL;

   if ((svr->client_limit >= 0) && (!svr->reject_excess_clients) &&
       (svr->client_count >= (unsigned int)svr->client_limit))
     return ECORE_CALLBACK_CANCEL;

   Ecore_Con_Client *cl_obj = efl_add(EFL_NETWORK_CLIENT_CLASS, efl_main_loop_get());
   Efl_Network_Client_Data *cl = efl_data_scope_get(obj, EFL_NETWORK_CLIENT_CLASS);
   if (!cl)
     {
        ERR("allocation failed");
        return ECORE_CALLBACK_CANCEL;
     }

   cl->host_server = obj;

   svr->event_read = CreateEvent(NULL, TRUE, FALSE, NULL);
   if (!svr->event_read)
     {
        ERR("Can not create event read");
        goto free_cl;
     }

   handler_read = ecore_main_win32_handler_add(svr->event_read,
                                               _ecore_con_local_win32_server_read_client_handler,
                                               obj);
   if (!handler_read)
     {
        ERR("Can not create handler read");
        goto close_event_read;
     }

   svr->event_peek = CreateEvent(NULL, TRUE, FALSE, NULL);
   if (!svr->event_peek)
     {
        ERR("Can not create event peek");
        goto del_handler_read;
     }

   handler_peek = ecore_main_win32_handler_add(svr->event_peek,
                                               _ecore_con_local_win32_server_peek_client_handler,
                                               obj);
   if (!handler_peek)
     {
        ERR("Can not create handler peek");
        goto close_event_peek;
     }

   svr->read_stopped = EINA_TRUE;
   svr->thread_read = (HANDLE)_beginthreadex(NULL, 0, _ecore_con_local_win32_server_read_client_thread, cl, CREATE_SUSPENDED, NULL);
   if (!svr->thread_read)
     {
        ERR("Can not launch thread");
        goto del_handler_peek;
     }

   svr->clients = eina_list_append(svr->clients, obj);
   svr->client_count++;

   if (!cl->delete_me)
     ecore_con_event_client_add(obj);

   ecore_main_win32_handler_del(wh);

   ResumeThread(svr->thread_read);
   return ECORE_CALLBACK_DONE;

del_handler_peek:
   ecore_main_win32_handler_del(handler_peek);
close_event_peek:
   CloseHandle(svr->event_peek);
del_handler_read:
   ecore_main_win32_handler_del(handler_read);
close_event_read:
   CloseHandle(svr->event_read);
free_cl:
   efl_del(cl_obj);

   return ECORE_CALLBACK_CANCEL;
}
예제 #6
0
EAPI int
eio_shutdown(void)
{
   Eio_File_Direct_Info *info;
   Eio_File_Char *cin;
   Eio_Progress *pg;
   Eio_File_Associate *asso;
   Eio_File *f;
   Eina_List *l;

   if (_eio_init_count <= 0)
     {
        ERR("Init count not greater than 0 in shutdown.");
        return 0;
     }
   if (--_eio_init_count != 0)
     return _eio_init_count;

   eina_log_timing(_eio_log_dom_global,
                   EINA_LOG_STATE_START,
                   EINA_LOG_STATE_SHUTDOWN);

   efl_del(io_manager);
   io_manager = NULL;

   EINA_LIST_FOREACH(tracked_thread, l, f)
     ecore_thread_cancel(f->thread);

   EINA_LIST_FREE(tracked_thread, f)
     {
        if (!ecore_thread_wait(f->thread, 0.5))
          CRI("We couldn't terminate in less than 30s some pending IO. This can led to some crash.");
     }

   efreet_mime_shutdown();

   eio_monitor_shutdown();

   eina_condition_free(&(memory_pool_cond));
   eina_lock_free(&(memory_pool_mutex));
   eina_spinlock_free(&(memory_pool_lock));

   eina_lock_free(&(direct_info_pool.lock));
   eina_lock_free(&(progress_pool.lock));
   eina_lock_free(&(char_pool.lock));
   eina_lock_free(&(associate_pool.lock));

   /* Cleanup pool */
   EINA_TRASH_CLEAN(&progress_pool.trash, pg)
     free(pg);
   progress_pool.count = 0;

   EINA_TRASH_CLEAN(&direct_info_pool.trash, info)
     free(info);
   direct_info_pool.count = 0;

   EINA_TRASH_CLEAN(&char_pool.trash, cin)
     free(cin);
   char_pool.count = 0;

   EINA_TRASH_CLEAN(&associate_pool.trash, asso)
     free(asso);
   associate_pool.count = 0;

   ecore_shutdown();
   eina_log_domain_unregister(_eio_log_dom_global);
   _eio_log_dom_global = -1;
   eina_shutdown();

   return _eio_init_count;
}