use size of hashtable instead of total threads created for thread cap

This commit is contained in:
Akash Mozumdar 2018-10-04 23:31:26 -04:00
parent 0b7db9e5ca
commit e126e4c4f3

View File

@ -35,7 +35,7 @@ namespace
LOCK(hostMutex); LOCK(hostMutex);
TextThread *it; TextThread *it;
if ((it = textThreadsByParams[tp]) == nullptr) if ((it = textThreadsByParams[tp]) == nullptr)
if (TextThread::ThreadCounter < MAX_THREAD_COUNT) if (textThreadsByParams.size() < MAX_THREAD_COUNT)
OnCreate(it = textThreadsByParams[tp] = new TextThread(tp, Host::GetHookParam(tp).type)); OnCreate(it = textThreadsByParams[tp] = new TextThread(tp, Host::GetHookParam(tp).type));
else return Host::AddConsoleOutput(L"too many text threads: stopping"); else return Host::AddConsoleOutput(L"too many text threads: stopping");
it->AddText(text, len); it->AddText(text, len);