You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am trying to implement a functionality to the rosbag_snapshot package to clear the buffer when it is disabled by calling the enable_snapshot service by 'false' value. In the snapshotter.cpp file, I added clear to the enableCB( ) function, but when I check the memory usage, the node does not free the memory it allocates after disabling it. Any help about this would be appreciated. Thanks in advance.
bool Snapshotter::enableCB(std_srvs::SetBool::Request& req, std_srvs::SetBool::Response& res)
{
boost::upgrade_lock<boost::upgrade_mutex> read_lock(state_lock_);
if (req.data && writing_) // Cannot enable while writing
{
res.success = false;
res.message = "cannot enable recording while writing.";
return true;
}
// Obtain write lock and update state if requested state is different from current
if (req.data && !recording_)
{
boost::upgrade_to_unique_lock<boost::upgrade_mutex> write_lock(read_lock);
resume();
}
else if (!req.data && recording_)
{
boost::upgrade_to_unique_lock<boost::upgrade_mutex> write_lock(read_lock);
pause();
clear(); // The part I added to the code !!
}
res.success = true;
return true;
}
The text was updated successfully, but these errors were encountered:
Hello,
I am trying to implement a functionality to the rosbag_snapshot package to clear the buffer when it is disabled by calling the enable_snapshot service by 'false' value. In the snapshotter.cpp file, I added clear to the enableCB( ) function, but when I check the memory usage, the node does not free the memory it allocates after disabling it. Any help about this would be appreciated. Thanks in advance.
The text was updated successfully, but these errors were encountered: