← 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

 

There are so many places where this should be added that we should find
another way.
For instance, the ++ operator of body's itarators could include the check.
It would automaticaly make future code removal safe.
Very few developers would imagine that iterating on bodies can return no
body.

B

p.s. Sorry if this a duplicate, I don't see my previous message in the list.

On 18 November 2011 13:27, <noreply@xxxxxxxxxxxxx> wrote:

> ------------------------------------------------------------
> revno: 2961
> fixes bug: https://launchpad.net/bugs/891540
> committer: Anton Gladky <gladky.anton@xxxxxxxxx>
> branch nick: yade
> timestamp: Fri 2011-11-18 13:25:48 +0100
> message:
>  Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540
> modified:
>  pkg/dem/GlobalStiffnessTimeStepper.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<https://code.launchpad.net/%7Eyade-dev/yade/trunk/+edit-subscription>
>
> === modified file 'pkg/dem/GlobalStiffnessTimeStepper.cpp'
> --- pkg/dem/GlobalStiffnessTimeStepper.cpp      2010-11-07 11:46:20 +0000
> +++ pkg/dem/GlobalStiffnessTimeStepper.cpp      2011-11-18 12:25:48 +0000
> @@ -73,6 +73,7 @@
>        BodyContainer::iterator biEnd = bodies->end();
>        for(  ; bi!=biEnd ; ++bi )
>        {
> +               if (!*bi)  continue;
>                shared_ptr<Body> b = *bi;
>                if (b->isDynamic()) findTimeStepFromBody(b, ncb);
>        }
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp
>
>

References