Comment 16 for bug 803774

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote : Re: [Yade-dev] [Bug 803774] Re: Saving, loading simulation with erased bodies crash.

This fix is correct I think.
If I guess correctly (I didn't check the code), the problem is that calling
erase(i) on an interaction is not erasing immediatly. Instead it sends a
message to the collider to erase "i" at next step. If you save, the next
step never comes and junk interactions are saved.

An alternative fix would be to check bodies before saving (if b1 or b2 does
not exist, don't save). I'm not sure it would be better, but it would be
more complicated probably.