Change-Id: Iea2ae18e9b2dd6042fa1e86eda54fa8ef7b5fdb6
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
static void __attribute__((destructor))
__tpl_runtime_fini(void)
{
- if (runtime != NULL) {
- int i;
-
- if (!pthread_mutex_lock(&runtime_mutex)) {
+ if (!pthread_mutex_lock(&runtime_mutex)) {
+ if (runtime != NULL) {
+ int i;
for (i = 0; i < TPL_BACKEND_COUNT; i++) {
if (runtime->displays[i] != NULL)
__tpl_hashlist_destroy(&(runtime->displays[i]));
+ if (runtime->surfaces[i] != NULL)
+ __tpl_hashlist_destroy(&(runtime->surfaces[i]));
}
- pthread_mutex_unlock(&runtime_mutex);
+
+ free(runtime);
+ runtime = NULL;
}
- free(runtime);
- runtime = NULL;
+ pthread_mutex_unlock(&runtime_mutex);
}
#ifdef OBJECT_HASH_CHECK