mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 06:56:39 +00:00 
			
		
		
		
	Assign the return value of weak_ptr::lock() to a variable, so that the
shared object lifetime is properly extended. Otherwise there is a possibility that the Actor gets destroyed during call to unstuck().
This commit is contained in:
		
							parent
							
								
									83af0402b8
								
							
						
					
					
						commit
						1650dabed8
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -599,7 +599,7 @@ namespace MWPhysics
 | 
			
		|||
        if (!mRemainingSteps)
 | 
			
		||||
            return;
 | 
			
		||||
        for (auto& data : mActorsFrameData)
 | 
			
		||||
            if (data.mActor.lock())
 | 
			
		||||
            if (const auto actor = data.mActor.lock())
 | 
			
		||||
            {
 | 
			
		||||
                std::unique_lock lock(mCollisionWorldMutex);
 | 
			
		||||
                MovementSolver::unstuck(data, mCollisionWorld);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue