summaryrefslogtreecommitdiff
path: root/src/lib/ephysics
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
parent1c267deb8f0ebe38b04016ebd23e5831ae35706f (diff)
ephysics - fix real access-after-free issue on delete of constraint
this fixes CID 1039895
Diffstat (limited to 'src/lib/ephysics')
-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 5e36fcb..7fcc4b5 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)
403 return; 403 return;
404 } 404 }
405 405
406 ephysics_world_lock_take(constraint->world); 406 // technically at this point locking and unlocking is pointless because
407 // if another thread is accessing this constraint, after this point it
408 // will be broken locks or not. this removes a segv in locking something
409 // we freed in _ephysics_constraint_del() by not locking.
407 _ephysics_constraint_del(constraint); 410 _ephysics_constraint_del(constraint);
408 INF("Constraint deleted."); 411 INF("Constraint deleted.");
409 ephysics_world_lock_release(constraint->world);
410} 412}
411 413
412 414