Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix static destruction ordering issue on macOS #16

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/rosconsole_bridge/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ class OutputHandlerROS : public console_bridge::OutputHandler
{
public:
OutputHandlerROS(void);
~OutputHandlerROS();
virtual void log(const std::string &text, console_bridge::LogLevel level, const char *filename, int line);
};

struct RegisterOutputHandlerProxy
{
RegisterOutputHandlerProxy(void);
~RegisterOutputHandlerProxy();
};

}
Expand Down
9 changes: 5 additions & 4 deletions src/bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ OutputHandlerROS::OutputHandlerROS(void) : OutputHandler()
{
}

OutputHandlerROS::~OutputHandlerROS(void) {
console_bridge::restorePreviousOutputHandler();
}

void OutputHandlerROS::log(const std::string &text, console_bridge::LogLevel level, const char *filename, int line)
{
std::string prefix;
Expand Down Expand Up @@ -130,4 +126,9 @@ RegisterOutputHandlerProxy::RegisterOutputHandlerProxy(void)
console_bridge::setLogLevel(console_bridge::CONSOLE_BRIDGE_LOG_DEBUG);
}

RegisterOutputHandlerProxy::~RegisterOutputHandlerProxy()
{
console_bridge::restorePreviousOutputHandler();
}

}
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How can we ensure that the binary goes to build dir only, not devel dir?
add_executable(cleanup cleanup.cpp)
target_link_libraries(cleanup rosconsole_bridge)
add_test(cleanup COMMAND cleanup)
add_test(NAME cleanup COMMAND cleanup)