When calling the vos_threadRegisterLocal(BOOL bStart) with the bStart value set to true, if the thread fails to get created (the execution goes inside the if (tsHandel == -1) block), the code quits the for loop (as intended), but then, despite the fact that the handle is negative, it still attempts to start this thread:
if (bStart)
{
TSstart(tsHandel);
}
Which is causing a crash.
Changed line 269
from
if (bStart)
to
if (bStart && ret == VOS_NO_ERR)