Avoid unbalanced locks when calling event-free callbacks.
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@62348
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
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);
#ifdef HAVE_EVIL
evil_shutdown();
#endif
+unlock:
+ _ecore_unlock();
return _ecore_init_count;
}