Hello
a network bug, discovered together with Jika looks like this:
If you order the air plane to drop bombs at a very high place the the non
turn master gets an assertion failure. (local_seed == random_seed)
In the background the following happens:
The plane drops the first bomb and stores a pointer to the last dropped
bomb in a variable. The height of the last bomb is then used to determine
when the next bomb should be dropped. However if the bomb is dropped at a
place where the ground is very high then the bomb explodes before the
second bomb gets dropped. When the bomb explodes it gets freed, but the
plane does still access it. So if and when the second bomb gets dropped
depends in this case if the computer reuses the space where the bomb
object has been or not.
I suggest that we use the smart pointers of the boost library to fix this
bug:
I would use "shared_ptr"s in the object list and a weak_ptr in the plane.
This way the plane will know when the bomb has exploded.
Attached is a patch which sets the last bomb variable to NULL when the
object gets freed. This way it becomes more obvious that it's buggy.
Best regards,
Florian
_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev