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
+6 -4
View File
@@ -303,16 +303,18 @@ namespace sdl
return i->second;
}
Thread **ThreadModule::getThreads()
void ThreadModule::getThreads(Thread ** list)
{
Thread **list = new Thread*[threads.size()+1];
int c = 0;
for (threadlist_t::iterator i = threads.begin(); i != threads.end(); i++, c++)
{
list[c] = i->second;
}
list[threads.size()] = 0;
return list;
}
unsigned ThreadModule::getThreadCount() const
{
return threads.size();
}
void ThreadModule::unregister(const std::string & name)