aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ephysics/ephysics_constraints.cpp
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-11 19:38:46 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-12-11 19:38:46 +0900
commit4d7edf623b8d66bc3925589e2c0c6f36e0fdf978 (patch)
tree4fc8b26995e76e5723cceefc542dd4a5840df8a5 /src/lib/ephysics/ephysics_constraints.cpp
parentecore-con - dns.c - fix double free (diff)
downloadefl-4d7edf623b8d66bc3925589e2c0c6f36e0fdf978.tar.gz
ephysics - fix real access-after-free issue on delete of constraint
this fixes CID 1039895
Diffstat (limited to 'src/lib/ephysics/ephysics_constraints.cpp')
-rw-r--r--src/lib/ephysics/ephysics_constraints.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/ephysics/ephysics_constraints.cpp b/src/lib/ephysics/ephysics_constraints.cpp
index 5e36fcbf36..7fcc4b57ec 100644
--- a/src/lib/ephysics/ephysics_constraints.cpp
+++ b/src/lib/ephysics/ephysics_constraints.cpp
@@ -403,10 +403,12 @@ ephysics_constraint_del(EPhysics_Constraint *constraint)
return;
}
- ephysics_world_lock_take(constraint->world);
+ // technically at this point locking and unlocking is pointless because
+ // if another thread is accessing this constraint, after this point it
+ // will be broken locks or not. this removes a segv in locking something
+ // we freed in _ephysics_constraint_del() by not locking.
_ephysics_constraint_del(constraint);
INF("Constraint deleted.");
- ephysics_world_lock_release(constraint->world);
}