aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore/ecore.c
diff options
context:
space:
mode:
authorMike McCormack <mj.mccormack@samsung.com>2011-08-11 12:01:19 +0000
committerMike McCormack <mikem@ring3k.org>2011-08-11 12:01:19 +0000
commit0fad5661b067ad3cadbd3889de0784f38b4d96eb (patch)
tree2ca61e39b85d0f97d84b0b4c248d5acfe0da37fb /legacy/ecore/src/lib/ecore/ecore.c
parentecore: Avoid returning when holding locks (diff)
downloadefl-0fad5661b067ad3cadbd3889de0784f38b4d96eb.tar.gz
ecore: Lock in ecore_shutdown
Avoid unbalanced locks when calling event-free callbacks. Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> SVN revision: 62348
Diffstat (limited to 'legacy/ecore/src/lib/ecore/ecore.c')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore.c b/legacy/ecore/src/lib/ecore/ecore.c
index 7f3ff58f37..9b14b5568d 100644
--- a/legacy/ecore/src/lib/ecore/ecore.c
+++ b/legacy/ecore/src/lib/ecore/ecore.c
@@ -177,8 +177,12 @@ ecore_init(void)
EAPI int
ecore_shutdown(void)
{
+ /*
+ * take a lock here because _ecore_event_shutdown() does callbacks
+ */
+ _ecore_lock();
if (--_ecore_init_count != 0)
- return _ecore_init_count;
+ goto unlock;
ecore_pipe_del(_thread_call);
eina_lock_free(&_thread_safety);
@@ -217,6 +221,8 @@ ecore_shutdown(void)
#ifdef HAVE_EVIL
evil_shutdown();
#endif
+unlock:
+ _ecore_unlock();
return _ecore_init_count;
}