示例#1
0
文件: zrpcdb.c 项目: zmike/ezrpc
/**
 * Close anything opened by this module
 */
Eina_Bool uninit(DB *db) {
	EINA_SAFETY_ON_NULL_RETURN_VAL(db, EINA_FALSE);
	INF("Uninitializing source 'zrpcdb'");

	if (db->config)
		db_config_free(db->config);

	if (db->e){
		INF("Connection pool teardown for 'zrpcdb'");
		esql_free(db->e);
		INF("Uninitialization of source 'zrpcdb' complete");
	}
	if (--init_count == 0){
		ecore_event_handler_del(zrpc_res);
		zrpc_res = NULL;
		ecore_event_handler_del(zrpc_err);
		zrpc_err = NULL;
	}
	if (type_cbs) eina_hash_free(type_cbs);
	type_cbs = NULL;
	if (db_cbs) eina_hash_free(db_cbs);
	db_cbs = NULL;
	if (db_cb_params) eina_hash_free(db_cb_params);
	db_cb_params = NULL;

	esql_shutdown();
	eina_shutdown();
	return EINA_TRUE;
}
示例#2
0
文件: ewk_js.cpp 项目: dog-god/iptv
/**
 * Release resources allocated by @a cls.
 *
 * @param cls @a Ewk_JS_Class to be released.
 */
void ewk_js_class_free(Ewk_JS_Class* jsClass)
{
    EINA_SAFETY_ON_NULL_RETURN(jsClass);
    eina_hash_free(jsClass->methods);
    eina_hash_free(jsClass->properties);
    free(jsClass);
}
示例#3
0
/* will dlclose all the modules loaded and free all the structs */
void
evas_module_shutdown(void)
{
   Eina_Module *en;
   char *path;
   int i;

   for (i = 0; evas_static_module[i].shutdown; ++i)
     evas_static_module[i].shutdown();

   EINA_LIST_FREE(eina_evas_modules, en)
     eina_module_free(en);

   eina_hash_free(evas_modules[EVAS_MODULE_TYPE_ENGINE]);
   evas_modules[EVAS_MODULE_TYPE_ENGINE] = NULL;
   eina_hash_free(evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER]);
   evas_modules[EVAS_MODULE_TYPE_IMAGE_LOADER] = NULL;
   eina_hash_free(evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER]);
   evas_modules[EVAS_MODULE_TYPE_IMAGE_SAVER] = NULL;
   eina_hash_free(evas_modules[EVAS_MODULE_TYPE_OBJECT]);
   evas_modules[EVAS_MODULE_TYPE_OBJECT] = NULL;

   EINA_LIST_FREE(evas_module_paths, path)
     free(path);

   eina_array_free(evas_engines);
   evas_engines = NULL;
}
示例#4
0
/**
 * @brief Free an #Azy_Client
 *
 * This function frees a client and ALL associated data.  If called
 * on a connected client, azy_client_close will be called and then the client
 * will be freed.
 * @param client The client (NOT NULL)
 */
void
azy_client_free(Azy_Client *client)
{
   DBG("(client=%p)", client);

   if (!AZY_MAGIC_CHECK(client, AZY_MAGIC_CLIENT))
     {
        AZY_MAGIC_FAIL(client, AZY_MAGIC_CLIENT);
        return;
     }

   if (client->connected)
     azy_client_close(client);
   AZY_MAGIC_SET(client, AZY_MAGIC_NONE);
   if (client->addr)
     eina_stringshare_del(client->addr);
   if (client->session_id)
     eina_stringshare_del(client->session_id);
   if (client->add)
     ecore_event_handler_del(client->add);
   if (client->del)
     ecore_event_handler_del(client->del);
   if (client->upgrade)
     ecore_event_handler_del(client->upgrade);
   if (client->callbacks)
     eina_hash_free(client->callbacks);
   if (client->free_callbacks)
     eina_hash_free(client->free_callbacks);
   if (client->conns)
     client->conns = eina_list_free(client->conns);
   free(client);
}
示例#5
0
EINTERN int
e_dnd_shutdown(void)
{
   E_FREE_LIST(_drag_list, e_object_del);

   _active_handlers = eina_list_free(_active_handlers);
   E_FREE_LIST(_drop_handlers, e_drop_handler_del);

   E_FREE_LIST(_event_handlers, ecore_event_handler_del);

   eina_hash_free(_drop_win_hash);

   eina_hash_free(_drop_handlers_responsives);

   eina_stringshare_del(_type_text_uri_list);
   eina_stringshare_del(_type_xds);
   eina_stringshare_del(_type_text_x_moz_url);
   eina_stringshare_del(_type_enlightenment_x_file);
   _type_text_uri_list = NULL;
   _type_xds = NULL;
   _type_text_x_moz_url = NULL;
   _type_enlightenment_x_file = NULL;
   _text_atom = 0;

   return 1;
}
示例#6
0
void
_elm_module_shutdown(void)
{
   // FIXME: unload all modules
   if (modules) eina_hash_free(modules);
   modules = NULL;
   if (modules_as) eina_hash_free(modules_as);
   modules_as = NULL;
}
示例#7
0
void
evas_font_dir_cache_free(void)
{
   if (font_dirs)
     {
        eina_hash_foreach(font_dirs, font_cache_dir_free, NULL);
        eina_hash_free(font_dirs);
        font_dirs = NULL;
     }

#ifdef HAVE_FONTCONFIG
   if (fc_init > 0)
     {
        fc_init--;
/* this is bad i got a:
 * fccache.c:512: FcCacheFini: Assertion fcCacheChains[i] == ((void *)0)' failed.   
 * 
 * all i can do for now is shut this puppy down. butthat breaks, so disable
 * it as in reality - there is little reason to care about the memory not
 * being freed etc.
 * 
 * note 04/08/2012 - this doesnt seem to cause an issue anymore?
 */
        if (fc_init == 0) FcFini();
     }
#endif
}
/**
 * @internal
 * @returns the number of initializations left for this system
 * @brief Attempts to shut down the subsystem if nothing else is using it
 */
void
efreet_desktop_shutdown(void)
{
    Efreet_Desktop_Type_Info *info;
    char *dir;

    if (efreet_desktop_exe_handler) ecore_event_handler_del(efreet_desktop_exe_handler);
    IF_RELEASE(desktop_environment);
    IF_FREE_HASH(efreet_desktop_cache);
    while (efreet_desktop_types)
    {
        info = eina_list_data_get(efreet_desktop_types);
        efreet_desktop_type_info_free(info);
        efreet_desktop_types = eina_list_remove_list(efreet_desktop_types,
                                                     efreet_desktop_types);
    }
    EINA_LIST_FREE(efreet_desktop_dirs, dir)
        eina_stringshare_del(dir);
    if (cache_monitor) ecore_file_monitor_del(cache_monitor);
    if (change_monitors) eina_hash_free(change_monitors);
    if (cache) eet_close(cache);
    efreet_desktop_edd_shutdown(desktop_edd);
    ecore_file_shutdown();
    eina_log_domain_unregister(_efreet_desktop_log_dom);
    IF_RELEASE(cache_file);
    IF_RELEASE(cache_dirs);
    if (efreet_desktop_job) ecore_job_del(efreet_desktop_job);
    efreet_desktop_job = NULL;
}
示例#9
0
/**
 * Module specific face freeing.
 *
 * It is called when a face is freed.
 *
 * @param   data the pointer you passed to e_gadget_new().
 * @param   face a pointer to your E_Gadget_Face.
 * @ingroup Emu_Module_Gadget_Group
 */
static void
_gc_shutdown(E_Gadcon_Client *gcc)
{
   Emu_Face *emu_face;

   emu_face = gcc->data;
   if (emu_face)
     {
        eina_hash_foreach(emu_face->menus, _emu_menus_hash_cb_free, NULL);
        eina_hash_free(emu_face->menus);
        emu_face->menus = NULL;

        if (emu_face->read)
           ecore_event_handler_del(emu_face->read);
        if (emu_face->add)
           ecore_event_handler_del(emu_face->add);
        if (emu_face->del)
           ecore_event_handler_del(emu_face->del);

        if (emu_face->exe)
           ecore_exe_terminate(emu_face->exe);
        if (emu_face->command)
           eina_stringshare_del(emu_face->command);

        evas_object_del(emu_face->o_button);
        E_FREE(emu_face);
     }
}
示例#10
0
void
efreet_cache_shutdown(void)
{
    Efreet_Old_Cache *d;

    IF_RELEASE(theme_name);

    icon_cache = efreet_cache_close(icon_cache);
    icon_theme_cache = efreet_cache_close(icon_theme_cache);

    IF_FREE_HASH(themes);
    IF_FREE_HASH(icons);
    IF_FREE_HASH(fallbacks);

    IF_FREE_HASH_CB(desktops, EINA_FREE_CB(efreet_cache_desktop_free));
    desktop_cache = efreet_cache_close(desktop_cache);
    IF_RELEASE(desktop_cache_file);

    efreet_cache_edd_shutdown();
    IF_RELEASE(icon_theme_cache_file);

    if (old_desktop_caches)
        ERR("This application has not properly closed all its desktop references!");
    EINA_LIST_FREE(old_desktop_caches, d)
    {
        eina_hash_free(d->hash);
        eet_close(d->ef);
        free(d);
    }
EINTERN int
e_mod_comp_atoms_shutdown(void)
{
   if (atoms_hash) eina_hash_free(atoms_hash);
   atoms_hash = NULL;
   return 1;
}
示例#12
0
END_TEST

START_TEST(eina_hash_extended)
{
   Eina_Hash *hash = NULL;
   int i;

        fail_if(eina_init() != 2);

   hash = eina_hash_string_djb2_new(NULL);
        fail_if(hash == NULL);

        fail_if(eina_hash_direct_add(hash, "42", "42") != EINA_TRUE);

   for (i = 43; i < 3043; ++i)
     {
        char *tmp = malloc(10);
        fail_if(!tmp);
        eina_convert_itoa(i, tmp);
        fail_if(eina_hash_direct_add(hash, tmp, tmp) != EINA_TRUE);
     }

        fail_if(eina_hash_find(hash, "42") == NULL);

        eina_hash_free(hash);

   fail_if(eina_shutdown() != 1);
}
示例#13
0
int main(int c, char **v)
{
   int wfd, rfd;
   Slave_Command cmd;
   void *params = NULL;
   Eina_Module *m;
   Eina_Bool quit = EINA_FALSE;

   if (c < 3)
     return 1;

   eina_init();
   pfx =  eina_prefix_new(v[0], main,
                          "EVAS", "evas", "checkme",
                          PACKAGE_BIN_DIR,
                          PACKAGE_LIB_DIR,
                          PACKAGE_DATA_DIR,
                          PACKAGE_DATA_DIR);

   loaders = eina_hash_string_superfast_new(NULL);
   evas_module_init();

   wfd = atoi(v[1]);
   rfd = atoi(v[2]);

   while (!quit)
     {
        if (!command_read(rfd, &cmd, &params))
          {
             error_send(wfd, CSERVE2_INVALID_COMMAND);
             return 1;
          }
        switch (cmd)
          {
           case IMAGE_OPEN:
             handle_image_open(wfd, params);
             break;
           case IMAGE_LOAD:
             handle_image_load(wfd, params);
             break;
           case SLAVE_QUIT:
             quit = EINA_TRUE;
             break;
           default:
             error_send(wfd, CSERVE2_INVALID_COMMAND);
          }
     }

   evas_module_shutdown();
   eina_hash_free(loaders);

   EINA_LIST_FREE(modules, m)
      eina_module_free(m);

   eina_prefix_free(pfx);
   eina_shutdown();

   return 0;
}
示例#14
0
文件: eio_file.c 项目: wargio/efl
static void
_eio_file_heavy(void *data, Ecore_Thread *thread)
{
   Eio_File_Char_Ls *async = data;
   Eina_Iterator *ls;
   const char *file;
   Eina_List *pack = NULL;
   double start;

   ls = eina_file_ls(async->ls.directory);
   if (!ls)
     {
	eio_file_thread_error(&async->ls.common, thread);
	return;
     }

   eio_file_container_set(&async->ls.common, eina_iterator_container_get(ls));

   start = ecore_time_get();

   EINA_ITERATOR_FOREACH(ls, file)
     {
	Eina_Bool filter = EINA_TRUE;

	if (async->filter_cb)
	  {
	     filter = async->filter_cb((void*) async->ls.common.data, &async->ls.common, file);
	  }

	if (filter)
          {
             Eio_File_Char *send_fc;

             send_fc = eio_char_malloc();
             if (!send_fc) goto on_error;

             send_fc->filename = file;
	     send_fc->associated = async->ls.common.worker.associated;
	     async->ls.common.worker.associated = NULL;

	     pack = eina_list_append(pack, send_fc);
          }
	else
          {
          on_error:
             eina_stringshare_del(file);

             if (async->ls.common.worker.associated)
               {
                  eina_hash_free(async->ls.common.worker.associated);
                  async->ls.common.worker.associated = NULL;
               }
          }

        pack = eio_pack_send(thread, pack, &start);

	if (ecore_thread_check(thread))
	  break;
     }
示例#15
0
E_API void
e_datastore_del(char *key)
{
   eina_hash_del(store, key, NULL);
   if (eina_hash_population(store)) return;
   eina_hash_free(store);
   store = NULL;
}
示例#16
0
文件: irc.c 项目: Limsik/e17
EMAPI int
protocol_shutdown(void)
{
   ecore_con_shutdown();
   if (_irc_servers)
     eina_hash_free(_irc_servers);
   return 1;
}
示例#17
0
void
free_device_get_all_properties(void *data)
{
   E_Ukit_Get_All_Properties_Return *ret = data;

   if (!ret) return;
   eina_hash_free(ret->properties);
   free(ret);
}
示例#18
0
static void
_grabber_tmdb_shutdown(void)
{
   INF("Shutdown TMDb grabber");
   eina_hash_free(_hash_req);
   free(_stats);
   ecore_con_url_shutdown();
   ecore_con_shutdown();
}
示例#19
0
EAPI void
efreet_mime_type_cache_clear(void)
{
    if (mime_icons)
    {
        eina_hash_free(mime_icons);
        mime_icons_lru = NULL;
    }
    mime_icons = eina_hash_stringshared_new(EINA_FREE_CB(efreet_mime_icon_entry_head_free));
}
示例#20
0
void edoors_room_free(Edoors_Room *room)
{
    DBG("Room free 0x%X",PRINTPTR(room));

    edoors_iota_desinit(&room->iota);
    // TODO room->links
    eina_hash_free(room->children);

    free(room);
}
示例#21
0
文件: elixir_id.c 项目: Limsik/e17
void
elixir_id_shutdown(void)
{
   eina_hash_free(ids);
   ids = NULL;

   elixir_id_close();

   eina_shutdown();
}
示例#22
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;
}
示例#23
0
END_TEST

START_TEST(eina_hash_all_int)
{
   Eina_Hash *hash;
   int64_t j[] = { 4321312301243122, 6, 7, 128 };
   int i[] = { 42, 6, 7, 0 };
   int64_t *test2;
   int *test;
   int it;

      fail_if(eina_init() != 2);

   hash = eina_hash_int32_new(NULL);
      fail_if(hash == NULL);

   for (it = 0; it < 4; ++it)
      fail_if(eina_hash_add(hash, &i[it], &i[it]) != EINA_TRUE);

      fail_if(eina_hash_del(hash, &i[1], &i[1]) != EINA_TRUE);
   test = eina_hash_find(hash, &i[2]);
      fail_if(test != &i[2]);

   test = eina_hash_find(hash, &i[3]);
      fail_if(test != &i[3]);

      eina_hash_free(hash);

   hash = eina_hash_int64_new(NULL);
      fail_if(hash == NULL);

   for (it = 0; it < 4; ++it)
      fail_if(eina_hash_add(hash, &j[it], &j[it]) != EINA_TRUE);

      fail_if(eina_hash_del(hash, &j[1], &j[1]) != EINA_TRUE);
   test2 = eina_hash_find(hash, &j[0]);
      fail_if(test2 != &j[0]);

      eina_hash_free(hash);

   fail_if(eina_shutdown() != 1);
}
示例#24
0
EINTERN int
e_popup_shutdown(void)
{
   if (_e_popup_hash)
     {
        eina_hash_free(_e_popup_hash);
        _e_popup_hash = NULL;
     }
   E_FN_DEL(ecore_event_handler_del, _e_popup_window_shape_handler);
   return 1;
}
示例#25
0
static void
_fid_del(_Function_Id *fid)
{
   _Parameter_Desc *param;
   if (!fid) return;
   eina_stringshare_del(fid->name);
   eina_hash_free(fid->data);
   EINA_LIST_FREE(fid->keys, param) _param_del(param);
   EINA_LIST_FREE(fid->params, param) _param_del(param);
   free(fid);
}
示例#26
0
EAPI void
efreet_hash_free(Eina_Hash *hash, Eina_Free_Cb free_cb)
{
    Eina_Iterator *it;
    void *data;

    it = eina_hash_iterator_data_new(hash);
    EINA_ITERATOR_FOREACH(it, data)
        (*free_cb)(data);
    eina_iterator_free(it);
    eina_hash_free(hash);
}
示例#27
0
EAPI void
elixir_context_delete(const char *key)
{
   if (!context) return ;

   eina_hash_del(context, key, NULL);

   if (eina_hash_population(context) == 0)
     {
	eina_hash_free(context);
	context = NULL;
     }
}
示例#28
0
static void
_em_main_shutdown(int errcode)
{
   int i = 0;

   eina_hash_free(em_protocols);
   /* loop the shutdown functions and call each one on the stack */
   for (i = (_em_main_level - 1); i >= 0; i--)
     (*_em_main_shutdown_func[i])();

   /* exit if we err'd */
   if (errcode < 0) exit(errcode);
}
示例#29
0
int
main(void)
{
   double start;
   Eina_Hash *headers;

   eina_init();
   ecore_init();
   ecore_file_init();

   if (ecore_file_exists(DST))
     ecore_file_unlink(DST);

   start = ecore_time_get();

   if (ecore_file_download(URL, DST, completion_cb, progress_cb, NULL, NULL))
     {
        printf("Download started successfully:\n  URL: %s\n  DEST: %s\n", URL, DST);
        ecore_main_loop_begin();
        printf("\nTime elapsed: %f seconds\n", ecore_time_get() - start);
        printf("Downloaded %lld bytes\n", ecore_file_size(DST));
     }
   else
     {
        printf("Error, can't start download\n");
        goto done;
     }

   headers = eina_hash_string_small_new(NULL);
   eina_hash_add(headers, "Content-type", "application/x-gzip");

   if (ecore_file_download_full(URL, DST_MIME, completion_cb, progress_cb, NULL, NULL, headers))
     {
        printf("Download started successfully:\n  URL: %s\n  DEST: %s\n", URL, DST_MIME);
        ecore_main_loop_begin();
        printf("\nTime elapsed: %f seconds\n", ecore_time_get() - start);
        printf("Downloaded %lld bytes\n", ecore_file_size(DST));
     }
   else
     {
        printf("Error, can't start download\n");
        goto done;
     }

done:
   if (headers) eina_hash_free(headers);
   ecore_file_shutdown();
   ecore_shutdown();
   eina_shutdown();
   return 0;
}
示例#30
0
文件: elm_module.c 项目: Limsik/e17
void
_elm_module_shutdown(void)
{
   Eina_Iterator *it;
   Elm_Module *m;

   if (modules)
     {
        Eina_List *tl = NULL;
        
        it = eina_hash_iterator_data_new(modules);

        EINA_ITERATOR_FOREACH(it, m) tl = eina_list_append(tl, m);
        eina_iterator_free(it);

        EINA_LIST_FREE(tl, m) _elm_module_del(m);

        eina_hash_free(modules);
        modules = NULL;
     }

   if (modules_as) eina_hash_free(modules_as);
   modules_as = NULL;
}