Changed getThreads so that the caller must allocate the memory.

This commit is contained in:
rude
2010-02-24 21:34:55 +01:00
parent 368765820e
commit 5fca0e9b33
3 changed files with 12 additions and 7 deletions
+4 -2
View File
@@ -260,9 +260,11 @@ namespace sdl
int w_getThreads(lua_State *L)
{
Thread **list = instance->getThreads();
unsigned count = instance->getThreadCount();
Thread **list = new Thread*[count];
instance->getThreads(list);
lua_newtable(L);
for (int i = 0; list[i] != 0; i++)
for (unsigned int i = 0; i<count; i++)
{
luax_newtype(L, "Thread", THREAD_THREAD_T, (void*) list[i]);
list[i]->lock();