evas: Fix a few issues after init/shutdown/init

elm_suite would crash when CK_FORK=no is set, because evas was
badly initializing or shutting down. Note that elm_suite still
crashes with CK_FORK=no but valgrind doesn't complain.
This commit is contained in:
Jean-Philippe Andre 2016-11-23 14:56:44 +09:00
parent dc18e71903
commit 69a684cf04
3 changed files with 10 additions and 7 deletions

View File

@ -98,8 +98,8 @@ evas_async_events_init(void)
{
int filedes[2];
_init_evas_event++;
if (_init_evas_event > 1) return _init_evas_event;
if (_init_evas_event++)
return _init_evas_event;
_fd_pid = getpid();
@ -136,8 +136,8 @@ evas_async_events_init(void)
int
evas_async_events_shutdown(void)
{
_init_evas_event--;
if (_init_evas_event > 0) return _init_evas_event;
if (--_init_evas_event)
return _init_evas_event;
eina_condition_free(&_thread_cond);
eina_lock_free(&_thread_mutex);
@ -145,9 +145,11 @@ evas_async_events_shutdown(void)
eina_lock_free(&_thread_feedback_mutex);
eina_spinlock_free(&_thread_id_lock);
free(async_queue_cache);
async_queue_cache = NULL;
eina_spinlock_free(&async_lock);
eina_inarray_flush(&async_queue);
free(async_queue_cache);
pipe_close(_fd_read);
pipe_close(_fd_write);

View File

@ -160,7 +160,7 @@ evas_shutdown(void)
evas_thread_shutdown();
_evas_preload_thread_shutdown();
evas_async_events_shutdown();
evas_common_shutdown();
//evas_common_shutdown();
evas_module_shutdown();
#ifdef BUILD_LOADER_EET

View File

@ -226,8 +226,9 @@ timeout_shutdown:
evas_thread_worker = 0;
eina_inarray_flush(&evas_thread_queue);
free(evas_thread_queue_cache);
evas_thread_queue_cache = NULL;
eina_inarray_flush(&evas_thread_queue);
eina_threads_shutdown();