ecore: fix segfault while adding new local or global data to thread.

This commit is contained in:
Mariusz Grzegorczyk 2013-09-03 12:44:27 +09:00 committed by Cedric Bail
parent 9ac13e4aec
commit ec67ea9c1e
1 changed files with 15 additions and 6 deletions

View File

@ -1135,9 +1135,14 @@ ecore_thread_local_data_set(Ecore_Thread *thread,
r = eina_hash_set(worker->hash, key, d);
CDB(worker->cond);
ret = r->data;
free(r);
return ret;
if (r)
{
ret = r->data;
free(r);
return ret;
}
return NULL;
}
EAPI void *
@ -1246,9 +1251,13 @@ ecore_thread_global_data_set(const char *key,
LRWKU(_ecore_thread_global_hash_lock);
CDB(_ecore_thread_global_hash_cond);
ret = r->data;
free(r);
return ret;
if (r)
{
ret = r->data;
free(r);
return ret;
}
return NULL;
}
EAPI void *