Parcourir la source

Fixed ThreadPool not removing unused threads

MarcoROG il y a 8 ans
Parent
commit
caab3c8c6b
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  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)
 		for(auto& thread : idleThreads)
 		{
 		{
-			if(i < limit)
+			if (i < limit)
+			{
 				mThreads.push_back(thread);
 				mThreads.push_back(thread);
+				i++;
+			}
 			else
 			else
 				destroyThread(thread);
 				destroyThread(thread);
 		}
 		}