← Back to team overview

yade-dev team mailing list archive

Re: [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

 

       for(  ; bi!=biEnd ; ++bi )

>        {
> +               if (!*bi)  continue;
>                shared_ptr<Body> b = *bi;
>
> I it not possible that iterator will return empty pointer. If it
> does, then it's a bug in the iterator.
>
>
The iterator is not empty, but the pointer it points to can be. Hence the
crash when somebody delete bodies.
That is why I suggested to make iterator incrementation jump null bodies.
At the moment we are slowly including such boring test in each other loop
on bodies in yade... It's ugly IMO.
Grep "FOREACH(body", you will see...

Bruno

Follow ups

References