Explorar o código

Fixed ThreadPool not removing unused threads

MarcoROG %!s(int64=8) %!d(string=hai) anos
pai
achega
caab3c8c6b
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      Source/BansheeUtility/Source/BsThreadPool.cpp

+ 4 - 1
Source/BansheeUtility/Source/BsThreadPool.cpp

@@ -261,8 +261,11 @@ namespace bs
 
 		for(auto& thread : idleThreads)
 		{
-			if(i < limit)
+			if (i < limit)
+			{
 				mThreads.push_back(thread);
+				i++;
+			}
 			else
 				destroyThread(thread);
 		}