forked from enlightenment/efl
ecore: thread - need to null check of function pointer
Summary: you can meet a segmentation fault without this patch Test Plan: please use the following snippet Ecore_Thread *th; th = ecore_thread_feedback_run(_heavy_cb, _notify_cb, NULL, NULL, obj, EINA_TRUE); ecore_thread_wait(th, 1.0); Reviewers: raster, Hermet, jaehwan, woohyun, cedric Reviewed By: cedric Subscribers: seoz Differential Revision: https://phab.enlightenment.org/D3315 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
f6de200c46
commit
163b50d0f1
|
@ -762,7 +762,7 @@ _ecore_thread_wait_cancel(void *data, Ecore_Thread *thread)
|
|||
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
|
||||
Ecore_Thread_Waiter *waiter = data;
|
||||
|
||||
waiter->func_cancel((void*) waiter->data, thread);
|
||||
if (waiter->func_cancel) waiter->func_cancel((void*) waiter->data, thread);
|
||||
_ecore_thread_wait_reset(waiter, worker);
|
||||
}
|
||||
|
||||
|
@ -772,7 +772,7 @@ _ecore_thread_wait_end(void *data, Ecore_Thread *thread)
|
|||
Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
|
||||
Ecore_Thread_Waiter *waiter = data;
|
||||
|
||||
waiter->func_end((void*) waiter->data, thread);
|
||||
if (waiter->func_end) waiter->func_end((void*) waiter->data, thread);
|
||||
_ecore_thread_wait_reset(waiter, worker);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue