Skip to content
This repository has been archived by the owner on Mar 5, 2022. It is now read-only.

Commit

Permalink
Release ScheduleTask instances in FakeMonkey::stopDeviceIO
Browse files Browse the repository at this point in the history
  • Loading branch information
cstawarz committed Jul 28, 2010
1 parent e4a3328 commit 2dd1759
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions FakeMonkeyPlugin/FakeMonkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void mFakeMonkey::spike(){
boost::exponential_distribution<double> dist = boost::exponential_distribution<double>(spike_rate->getValue().getFloat() / 1000000);
variate_generator<boost::mt19937&, boost::exponential_distribution<double> > sampler = variate_generator<boost::mt19937&, boost::exponential_distribution<double> >(rng,dist);

if(spike_node != NULL){
if(spike_node){
spike_node->cancel();
}

Expand Down Expand Up @@ -234,7 +234,7 @@ void mFakeMonkey::startSaccading(){
*status = M_FAKE_MONKEY_SACCADING;


if(movement_node != NULL){
if(movement_node){
movement_node->cancel();
}

Expand All @@ -260,7 +260,7 @@ void mFakeMonkey::startFixating(){

*status = M_FAKE_MONKEY_FIXATING;

if(movement_node != NULL){
if(movement_node){
movement_node->cancel();
}

Expand All @@ -285,11 +285,13 @@ bool mFakeMonkey::stopDeviceIO(){
boost::mutex::scoped_lock lock(*monkey_lock);

*status = M_FAKE_MONKEY_FIXATING;
if(movement_node != NULL){
if(movement_node){
movement_node->cancel();
movement_node.reset();
}
if(spike_node != NULL){
if(spike_node){
spike_node->cancel();
spike_node.reset();
}

return LegacyIODevice::stopDeviceIO();
Expand Down

0 comments on commit 2dd1759

Please sign in to comment.