Closed
Description
Hi,
I just noticed that the MinitraceLogger
throws an exception complaining that only one instance is allowed, even if all the previous instances were deleted. I think the reference variable should be set to false in the destructor. From bt_minitrace_logger.cpp
file (the exception message seems to be a bit off too):
MinitraceLogger::MinitraceLogger(TreeNode* root_node, const char* filename_json)
: StatusChangeLogger(root_node)
{
bool expected = false;
if (!ref_count.compare_exchange_strong(expected, true))
{
throw std::logic_error("Only one instance of StdCoutLogger shall be created");
}
minitrace::mtr_register_sigint_handler();
minitrace::mtr_init(filename_json);
this->enableTransitionToIdle(true);
}
MinitraceLogger::~MinitraceLogger()
{
minitrace::mtr_flush();
minitrace::mtr_shutdown();
}
Cheers.