← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2570: 1. Fix requestErase of erased interaction (thanks to Anton for reporting)

 

------------------------------------------------------------
revno: 2570
fixes bug(s): https://launchpad.net/bugs/681018
committer: Václav Šmilauer <eu@xxxxxxxx>
branch nick: yade
timestamp: Thu 2010-11-25 09:56:11 +0100
message:
  1. Fix requestErase of erased interaction (thanks to Anton for reporting)
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	2010-11-24 19:54:29 +0000
+++ core/InteractionContainer.cpp	2010-11-25 08:56:11 +0000
@@ -84,7 +84,8 @@
 
 
 void InteractionContainer::requestErase(Body::id_t id1, Body::id_t id2, bool force){
-	find(id1,id2)->reset(); IdsForce v={id1,id2,force};
+	const shared_ptr<Interaction>& I=find(id1,id2); if(!I) return;
+	I->reset(); IdsForce v={id1,id2,force};
 	#ifdef YADE_OPENMP
 		threadsPendingErase[omp_get_thread_num()].push_back(v);
 	#else


Follow ups