From beb3357d98e41f58c86829ec5a2016373d830b4d Mon Sep 17 00:00:00 2001 From: barbieri Date: Tue, 21 Jul 2009 01:55:31 +0000 Subject: [PATCH] Eina rectangle missing list init. Rectangle needs the list module for the pool_new() function. Patch also adds a check for initialization error on the unit test. By: Andre Dieb git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@41460 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/eina_rectangle.c | 10 ++++++++++ src/tests/eina_test_rectangle.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/eina_rectangle.c b/src/lib/eina_rectangle.c index c72fc04..43babe8 100644 --- a/src/lib/eina_rectangle.c +++ b/src/lib/eina_rectangle.c @@ -242,6 +242,12 @@ eina_rectangle_init(void) goto mempool_init_error; } + if (!eina_list_init()) + { + EINA_ERROR_PERR("Could not initialize eina list module.\n"); + goto list_init_error; + } + #ifdef EINA_DEFAULT_MEMPOOL choice = "pass_through"; #else @@ -267,6 +273,8 @@ eina_rectangle_init(void) return _eina_rectangle_init_count; init_error: + eina_list_shutdown(); + list_init_error: eina_mempool_shutdown(); mempool_init_error: eina_error_shutdown(); @@ -281,6 +289,8 @@ eina_rectangle_shutdown(void) if (_eina_rectangle_init_count) return _eina_rectangle_init_count; + eina_list_shutdown(); + eina_mempool_del(_eina_rectangle_alloc_mp); eina_mempool_del(_eina_rectangle_mp); diff --git a/src/tests/eina_test_rectangle.c b/src/tests/eina_test_rectangle.c index 307bcb1..e50950d 100644 --- a/src/tests/eina_test_rectangle.c +++ b/src/tests/eina_test_rectangle.c @@ -34,7 +34,7 @@ START_TEST(eina_rectangle_pool) int w; int h; - eina_rectangle_init(); + fail_if(!eina_rectangle_init()); pool = eina_rectangle_pool_new(256, 256); fail_if(pool == NULL); -- 2.7.4