From 6208fcfaf3b6113e1f07a93c19c7f7521bedae4c Mon Sep 17 00:00:00 2001 From: Bruno Dilly Date: Thu, 5 Jul 2012 22:53:28 +0000 Subject: [PATCH] EPhysics: properly initializes library It wasn't initializing required libs. SVN revision: 73384 --- legacy/ephysics/src/lib/ephysics_main.cpp | 37 +++++++++++++++++++---- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/legacy/ephysics/src/lib/ephysics_main.cpp b/legacy/ephysics/src/lib/ephysics_main.cpp index 35680b378f..09ad9ce60a 100644 --- a/legacy/ephysics/src/lib/ephysics_main.cpp +++ b/legacy/ephysics/src/lib/ephysics_main.cpp @@ -2,6 +2,9 @@ # include #endif +#include "Ecore.h" +#include "Eina.h" + #include "ephysics_private.h" #ifdef __cplusplus @@ -17,24 +20,43 @@ ephysics_init() if (++_ephysics_init_count != 1) return _ephysics_init_count; + if (!eina_init()) + { + EINA_LOG_CRIT("Couldn't init eina"); + return --_ephysics_init_count; + } + + if (!ecore_init()) + { + EINA_LOG_CRIT("Couldn't init ecore"); + goto no_ecore; + } + _ephysics_log_dom = eina_log_domain_register("ephysics", EPHYSICS_LOG_COLOR); if (_ephysics_log_dom < 0) { - EINA_LOG_ERR("Couldn't create a log domain for ephysics"); - return --_ephysics_init_count; + EINA_LOG_CRIT("Couldn't create a log domain for ephysics"); + goto no_log; } if (!ephysics_world_init()) { - ERR("Couldn't initialize worlds"); - eina_log_domain_unregister(_ephysics_log_dom); - _ephysics_log_dom = -1; - return --_ephysics_init_count; + ERR("Couldn't initialize worlds"); + goto no_world; } INF("EPhysics initialized"); return _ephysics_init_count; + +no_world: + eina_log_domain_unregister(_ephysics_log_dom); + _ephysics_log_dom = -1; +no_log: + ecore_shutdown(); +no_ecore: + eina_shutdown(); + return --_ephysics_init_count; } EAPI int @@ -50,6 +72,9 @@ ephysics_shutdown() eina_log_domain_unregister(_ephysics_log_dom); _ephysics_log_dom = -1; + ecore_shutdown(); + eina_shutdown(); + return _ephysics_init_count; }