Skip to content

Commit

Permalink
os: fix for bug 1046: OSX 10.8, boost 1.54, apple-gcc-4.2 RTT main-te…
Browse files Browse the repository at this point in the history
…st FAILS

Apparently copying the boost functions went wrong and we ended up with a NULL pointer.
Fixed by directly using the function pointer instead of the boost function.

Signed-off-by: Ruben Smits <[email protected]>
Ruben Smits committed Oct 9, 2013
1 parent 5ff77e0 commit 73cb586
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion rtt/os/StartStopManager.cpp
Original file line number Diff line number Diff line change
@@ -75,7 +75,8 @@ namespace RTT
//startv.resize( startv.size() );
//stopv.resize( stopv.size() );
res = true;
std::for_each(startv.begin(), startv.end(), boost::function<void (start_fun)>( std::bind1st(std::mem_fun( &StartStopManager::res_collector ), this) ) );
for ( std::vector<start_fun>::iterator it = startv.begin(); it != startv.end(); ++it)
this->res_collector( *it );
return res;
}

7 changes: 4 additions & 3 deletions rtt/os/StartStopManager.hpp
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ namespace RTT

static void Release();

typedef boost::function<int (void)> start_fun;
typedef int (*start_fun)(void);
typedef boost::function<void (void)> stop_fun;

/**
@@ -100,13 +100,14 @@ namespace RTT

void res_collector( start_fun f )
{
if ( f() != 0 )
if ( f && f() != 0 )
res = false;
}

static void caller( stop_fun f)
{
f();
if (f)
f();
}

bool res;

0 comments on commit 73cb586

Please sign in to comment.