]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robofsm: fix problem with memory
authorPetr Silhavik <silhavik.p@gmail.com>
Tue, 26 Feb 2013 16:40:12 +0000 (17:40 +0100)
committerPetr Silhavik <silhavik.p@gmail.com>
Tue, 26 Feb 2013 16:40:12 +0000 (17:40 +0100)
src/robofsm/common-states.h
src/robofsm/movehelper.cc

index a61d9863301fccbe25b886be800fa352ca373afa..1d8fbcec1172ac4310420ef0b9142af84c1961c8 100644 (file)
@@ -288,7 +288,7 @@ struct move_around : TimedSimpleState<move_around, competing> {
        }
        sc::result react(const evMotionError&) {
 //             DBG_PRINT_EVENT("can not access survey point");
-               return discard_event();
+               return transit<survey>();
        }
        typedef mpl::list<
                sc::transition<evMotionDone, survey>,
index b39e79b6aa62b80c3d5418c69e1be64f5357b47a..4ab7520afbd3a52bab9cb3cf6bd42d25b3b413dd 100644 (file)
@@ -212,7 +212,7 @@ void MoveHelper::move_by(double distance, move_target_heading heading, Trajector
        target->heading = heading;
        target->trajectory = t;
        robot.sched.queue_event(robot.MOTION, new evNewTarget(target));
-       delete t;
+       t = NULL;
 }
 
 move_target_heading MoveHelper::trans_heading(move_target_heading h) {