← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2880: Fixes crash, causing by saving-loading simulation with erased bodies. Fixes #803774

 

------------------------------------------------------------
revno: 2880
fixes bug(s): https://launchpad.net/bugs/803774
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: yade
timestamp: Sat 2011-07-02 19:35:29 +0200
message:
  Fixes crash, causing by saving-loading simulation with erased bodies. Fixes #803774
modified:
  core/InteractionContainer.cpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'core/InteractionContainer.cpp'
--- core/InteractionContainer.cpp	2011-02-27 13:54:43 +0000
+++ core/InteractionContainer.cpp	2011-07-02 17:35:29 +0000
@@ -29,7 +29,9 @@
 void InteractionContainer::clear(){
 	assert(bodies);
 	boost::mutex::scoped_lock lock(drawloopmutex);
-	FOREACH(const shared_ptr<Body>& b, *bodies) b->intrs.clear(); // delete interactions from bodies
+	FOREACH(const shared_ptr<Body>& b, *bodies) {
+		if (b) b->intrs.clear(); // delete interactions from bodies
+	}
 	linIntrs.clear(); // clear the linear container
 	pendingErase.clear();
 	currSize=0;