提交 2f5a8e7d 编写于 作者: U UnityAlex

Implementing a more robust fix for the STV crash on close issue.

上级 db7260f0
......@@ -100,18 +100,23 @@ void _wapi_collection_init (void)
extern void _wapi_collection_shutdown (void)
{
// signal and wait for collection thread to fininsh
pthread_mutex_lock (&collection_thread_wait_mutex);
collection_thread_enabled = FALSE;
// Only clean up if the thread has been enabled
if(collection_thread_enabled != FALSE)
{
// signal and wait for collection thread to fininsh
pthread_mutex_lock (&collection_thread_wait_mutex);
pthread_cond_signal (&collection_thread_wait_cond);
pthread_mutex_unlock (&collection_thread_wait_mutex);
pthread_join (collection_thread_id, NULL);
collection_thread_enabled = FALSE;
// cleanup
pthread_cond_destroy (&collection_thread_wait_cond);
pthread_mutex_destroy (&collection_thread_wait_mutex);
pthread_cond_signal (&collection_thread_wait_cond);
pthread_mutex_unlock (&collection_thread_wait_mutex);
pthread_join (collection_thread_id, NULL);
// cleanup
pthread_cond_destroy (&collection_thread_wait_cond);
pthread_mutex_destroy (&collection_thread_wait_mutex);
}
}
......
......@@ -215,9 +215,7 @@ void _wapi_cleanup ()
_wapi_has_shut_down = TRUE;
#if !defined(DISABLE_SHARED_HANDLES)
_wapi_collection_shutdown ();
#endif
_wapi_critical_section_cleanup ();
_wapi_error_cleanup ();
_wapi_thread_cleanup ();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册