thread_wrapp - improve this a bit

This commit is contained in:
twinaphex 2016-07-04 11:39:20 +02:00
parent b2bc4cd300
commit b0ea1e09ac

View File

@ -97,9 +97,9 @@ static void *thread_wrap(void *data_)
#endif
{
struct thread_data *data = (struct thread_data*)data_;
if (!data || !data->func)
if (!data)
return 0;
if (data->userdata)
if (data->func && data->userdata)
data->func(data->userdata);
free(data);
return 0;