ros-pkg: fixed some memory leaks in data_recorder node

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/ros-pkg@1057 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2013-12-20 21:36:48 +00:00
parent 4616b8d876
commit 85bed07ef1
+17 -1
View File
@@ -40,7 +40,11 @@ class DataRecorderWrapper
public:
DataRecorderWrapper() :
fileName_(""),
frameId_("base_link")
frameId_("base_link"),
depthScanSync_(0),
depthSync_(0),
scanSync_(0),
depthImageSync_(0)
{
ros::NodeHandle pnh("~");
@@ -62,6 +66,18 @@ public:
return recorder_.init(fileName_.c_str());
}
virtual ~DataRecorderWrapper()
{
if(depthScanSync_)
delete depthScanSync_;
if(depthSync_)
delete depthSync_;
if(scanSync_)
delete scanSync_;
if(depthImageSync_)
delete depthImageSync_;
}
private:
void setupCallbacks(
bool subscribeOdom,