>From fc978818dbce81502759bd7b23645d0a2c26b5ac Mon Sep 17 00:00:00 2001 From: Matthias Goldhoorn Date: Fri, 10 Jan 2014 16:17:08 +0100 Subject: [PATCH 2/2] TaskContext: fixed zero pointer fault The our_act could be nil if there is a parent task given for execution. In this case our_act->stop() will defnilty fail. --- rtt/TaskContext.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rtt/TaskContext.cpp b/rtt/TaskContext.cpp index 298a927..e795786 100644 --- a/rtt/TaskContext.cpp +++ b/rtt/TaskContext.cpp @@ -352,7 +352,9 @@ namespace RTT #endif } new_act->stop(); - our_act->stop(); + if(our_act){ + our_act->stop(); + } new_act->run( this->engine() ); our_act = ActivityInterface::shared_ptr( new_act ); our_act->start(); @@ -364,7 +366,9 @@ namespace RTT if (!new_act) return; new_act->stop(); - our_act->stop(); + if(our_act){ + our_act->stop(); + } our_act.reset( new_act ); our_act->run( this->engine() ); our_act->start(); -- 1.8.5.1