With this patch, the only leaks left that I detected are these:
==20488== 20 bytes in 1 blocks are still reachable in loss record 1 of 3
==20488== at 0x4025092: calloc (vg_replace_malloc.c:397)
==20488== by 0x4233085: (within /lib/tls/i686/cmov/libdl-2.9.so)
==20488== by 0x4232B20: dlopen (in /lib/tls/i686/cmov/libdl-2.9.so)
==20488== by 0x4057B71: eina_module_load (eina_module.c:214)
==20488== by 0x4057C6C: eina_module_list_load (eina_module.c:420)
==20488== by 0x4054CAD: eina_mempool_init (eina_mempool.c:161)
==20488== by 0x40563AC: eina_list_init (eina_list.c:461)
==20488== by 0x4030DA4: eupnp_event_bus_init (eupnp_event_bus.c:89)
==20488== by 0x402E004: eupnp_init (eupnp.c:40)
==20488== by 0x80489D3: main (eupnp_basic_control_point.c:44)
==20488==
==20488==
==20488== 362 (72 direct, 290 indirect) bytes in 6 blocks are definitely
lost in loss record 2 of 3
==20488== at 0x4026FDE: malloc (vg_replace_malloc.c:207)
==20488== by 0x40576DC: eina_module_new (eina_module.c:267)
==20488== by 0x405782A: _dir_list_cb (eina_module.c:138)
==20488== by 0x405453D: eina_file_dir_list (eina_file.c:134)
==20488== by 0x40572BF: eina_module_list_get (eina_module.c:403)
==20488== by 0x4054B9D: eina_mempool_init (eina_mempool.c:141)
==20488== by 0x40563AC: eina_list_init (eina_list.c:461)
==20488== by 0x4030DA4: eupnp_event_bus_init (eupnp_event_bus.c:89)
==20488== by 0x402E004: eupnp_init (eupnp.c:40)
==20488== by 0x80489D3: main (eupnp_basic_control_point.c:44)
==20488==
==20488==
==20488== 290 bytes in 6 blocks are indirectly lost in loss record 3 of 3
==20488== at 0x4026FDE: malloc (vg_replace_malloc.c:207)
==20488== by 0x411734F: strdup (in /lib/tls/i686/cmov/libc-2.9.so)
==20488== by 0x40576E6: eina_module_new (eina_module.c:269)
==20488== by 0x405782A: _dir_list_cb (eina_module.c:138)
==20488== by 0x405453D: eina_file_dir_list (eina_file.c:134)
==20488== by 0x40572BF: eina_module_list_get (eina_module.c:403)
==20488== by 0x4054B9D: eina_mempool_init (eina_mempool.c:141)
==20488== by 0x40563AC: eina_list_init (eina_list.c:461)
==20488== by 0x4030DA4: eupnp_event_bus_init (eupnp_event_bus.c:89)
==20488== by 0x402E004: eupnp_init (eupnp.c:40)
==20488== by 0x80489D3: main (eupnp_basic_control_point.c:44)
--
André Dieb Martins
Embedded Systems and Pervasive Computing Lab (Embedded)
Electrical Engineering Department (DEE)
Center of Electrical Engineering and Informatics (CEEI)
Federal University of Campina Grande (UFCG)
Blog: http://genuinepulse.blogspot.com/
Index: src/lib/eina_mempool.c
===================================================================
--- src/lib/eina_mempool.c (revision 40899)
+++ src/lib/eina_mempool.c (working copy)
@@ -123,8 +123,16 @@
{
char *path;
- eina_hash_init();
- eina_module_init();
+ if (!eina_hash_init())
+ {
+ fprintf(stderr, "Could not initialize eina hash module.\n");
+ return 0;
+ }
+ if (!eina_module_init())
+ {
+ fprintf(stderr, "Could not initialize eina module module.\n");
+ goto module_init_error;
+ }
EINA_ERROR_NOT_MEMPOOL_MODULE = eina_error_msg_register("Not a memory pool module.");
_backends = eina_hash_string_superfast_new(NULL);
@@ -147,7 +155,8 @@
if (!_modules)
{
EINA_ERROR_PERR("ERROR: no mempool modules able to be loaded.\n");
- abort();
+ eina_hash_free(_backends);
+ goto mempool_init_error;
}
eina_module_list_load(_modules);
/* builtin backends */
@@ -165,6 +174,14 @@
#endif
}
return ++_init_count;
+
+ mempool_init_error:
+ eina_module_shutdown();
+ module_init_error:
+ eina_hash_shutdown();
+
+ return 0;
+
}
/**
@@ -191,8 +208,13 @@
#endif
/* dynamic backends */
eina_module_list_unload(_modules);
+ if (_modules)
+ eina_array_free(_modules);
eina_module_shutdown();
- /* TODO delete the _modules list */
+
+ if (_backends)
+ eina_hash_free(_backends);
+
eina_hash_shutdown();
return 0;
}
Index: src/lib/eina_error.c
===================================================================
--- src/lib/eina_error.c (revision 40899)
+++ src/lib/eina_error.c (working copy)
@@ -530,7 +530,6 @@
{
char *level;
/* TODO register the eina's basic errors */
- /* TODO load the environment variable for getting the log level */
if ((level = getenv("EINA_ERROR_LEVEL")))
{
_error_level = atoi(level);
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel