mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Thread wrapper checks for failed thread creation. (fixes #90)
This commit is contained in:
@@ -264,6 +264,8 @@ namespace sdl
|
|||||||
else
|
else
|
||||||
data = luax_checktype<love::Data>(L, 2, "Data", DATA_T);
|
data = luax_checktype<love::Data>(L, 2, "Data", DATA_T);
|
||||||
Thread *t = instance->newThread(name, data);
|
Thread *t = instance->newThread(name, data);
|
||||||
|
if (!t)
|
||||||
|
return luaL_error(L, "A thread with that name already exists.");
|
||||||
luax_newtype(L, "Thread", THREAD_THREAD_T, (void*)t);
|
luax_newtype(L, "Thread", THREAD_THREAD_T, (void*)t);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user