Author: mordante
Date: Sat Oct 15 15:29:16 2011
New Revision: 51485
URL: http://svn.gna.org/viewcvs/wesnoth?rev=51485&view=rev
Log:
Add a work-round for bug #18534.
The destructor of the class restored the moment of the units. When a
unit no longer exists it overwrites random memory. The issue has been
found by valgrind.
anonymissimus tested the work-around since he was able to reproduce the
issue easily, while on my system it went well for a long time.
Modified:
trunk/src/whiteboard/mapbuilder.cpp
Modified: trunk/src/whiteboard/mapbuilder.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/whiteboard/mapbuilder.cpp?rev=51485&r1=51484&r2=51485&view=diff
==============================================================================
--- trunk/src/whiteboard/mapbuilder.cpp (original)
+++ trunk/src/whiteboard/mapbuilder.cpp Sat Oct 15 15:29:16 2011
@@ -67,8 +67,16 @@
//Reset movement points, to be restored by destruction of
resetters_
+ /**
+ * @todo Fix this code.
+ *
+ * It has been disabled since the destructor of this class
restored the
+ * movement, also of deleted units causing bug #18534, as
work-around
+ * this code is disabled.
+ */
//restore movement points only to units not on the current side
- resetters_.push_back(new
unit_movement_resetter(u,!on_current_side));
+ //resetters_.push_back(new
unit_movement_resetter(u,!on_current_side));
+
//make sure current side's units are not reset to full moves on
first turn
if(on_current_side)
acted_this_turn_.insert(&u);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits