Skip to content

Commit

Permalink
Revert "slaveactivity: forward isPeriodic() member call to the master…
Browse files Browse the repository at this point in the history
… engine"

The mmaster pointer might be dangling and accessing it from the isPeriodic()
call in SlaveActivity::stop() triggers a segfault if the master is already
destroyed.

Ideally, activities would be managed in shared pointers only and the slave
activity uses the weak pointer concept to check if the master is still available.

This reverts commit cb4a376.
  • Loading branch information
meyerj committed Nov 16, 2016
1 parent e49cdf0 commit d04b1e9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions rtt/extras/SlaveActivity.cpp
Expand Up @@ -178,8 +178,6 @@ namespace RTT {

bool SlaveActivity::isPeriodic() const
{
if (mmaster)
return mmaster->isPeriodic();
return mperiod != 0.0;
}
bool SlaveActivity::isActive() const
Expand All @@ -204,7 +202,7 @@ namespace RTT {
bool SlaveActivity::execute()
{
// non periodic case.
if ( !isPeriodic() ) {
if ( mperiod == 0.0 ) {
if ( !active || running )
return false;
running = true;
Expand Down

0 comments on commit d04b1e9

Please sign in to comment.