mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03: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)
|
if (!mRemainingSteps)
|
||||||
return;
|
return;
|
||||||
for (auto& data : mActorsFrameData)
|
for (auto& data : mActorsFrameData)
|
||||||
if (data.mActor.lock())
|
if (const auto actor = data.mActor.lock())
|
||||||
{
|
{
|
||||||
std::unique_lock lock(mCollisionWorldMutex);
|
std::unique_lock lock(mCollisionWorldMutex);
|
||||||
MovementSolver::unstuck(data, mCollisionWorld);
|
MovementSolver::unstuck(data, mCollisionWorld);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue