From: mike_m Date: Thu, 11 Aug 2011 12:01:19 +0000 (+0000) Subject: ecore: Lock in ecore_shutdown X-Git-Tag: build/2012-07-04.173327~934 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d039061f7bb0afc4fe3c9630ffe29829d5b1f1c9;p=profile%2Fivi%2Fecore.git ecore: Lock in ecore_shutdown Avoid unbalanced locks when calling event-free callbacks. Signed-off-by: Mike McCormack git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@62348 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index 7f3ff58..9b14b55 100644 --- a/src/lib/ecore/ecore.c +++ b/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; }