summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2015-11-10 13:45:37 -0800
committerCedric BAIL <cedric@osg.samsung.com>2015-11-11 10:40:17 -0800
commit354e5f0d20cda15d9043b90bb44a25392a9b78e2 (patch)
treea7e5000f262747d464a964072cd6c69a233c0b25
parentf61ba2bfce204c59cfd70e5d7410034d3ac4f784 (diff)
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>
-rw-r--r--src/lib/ecore/ecore_thread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ecore/ecore_thread.c b/src/lib/ecore/ecore_thread.c
index 7266c09f43..7b88cf2182 100644
--- a/src/lib/ecore/ecore_thread.c
+++ b/src/lib/ecore/ecore_thread.c
@@ -760,7 +760,7 @@ _ecore_thread_wait_cancel(void *data, Ecore_Thread *thread)
760 Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread; 760 Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
761 Ecore_Thread_Waiter *waiter = data; 761 Ecore_Thread_Waiter *waiter = data;
762 762
763 waiter->func_cancel((void*) waiter->data, thread); 763 if (waiter->func_cancel) waiter->func_cancel((void*) waiter->data, thread);
764 _ecore_thread_wait_reset(waiter, worker); 764 _ecore_thread_wait_reset(waiter, worker);
765} 765}
766 766
@@ -770,7 +770,7 @@ _ecore_thread_wait_end(void *data, Ecore_Thread *thread)
770 Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread; 770 Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker*) thread;
771 Ecore_Thread_Waiter *waiter = data; 771 Ecore_Thread_Waiter *waiter = data;
772 772
773 waiter->func_end((void*) waiter->data, thread); 773 if (waiter->func_end) waiter->func_end((void*) waiter->data, thread);
774 _ecore_thread_wait_reset(waiter, worker); 774 _ecore_thread_wait_reset(waiter, worker);
775} 775}
776 776