Memory leake trigered by the realsense pipeline code c++
rs2::pipeline p;
rs2::config cfg;
cfg.enable_device_from_file("test.bag");
// Configure and start the pipeline
p.start(cfg);
int i = 0;
while (i++<5)
{
std::cout<<"i: "<<i<<std::endl;
// Block program until frames arrive
rs2::frameset frames = p.wait_for_frames();
if( !frames)
continue;
// Try to get a frame of a depth image
rs2::depth_frame depth = frames.get_depth_frame();
if (! depth)
continue;
// Get the depth frame's dimensions
auto width = depth.get_width();
auto height = depth.get_height();
// Query the distance from the camera to the object in the center of the image
float dist_to_center = depth.get_distance(width / 2, height / 2);
// Print the distance
std::cout << "The camera is facing an object " << dist_to_center << " meters away \r";
}
p.stop();
The above code snippet is showing some memory leakes when I run valgrind.
Is it the way the code is written or it's a known library issue. Any help will be appreiated.
thanks
-
This question is responded to at a copy of the case at the link below.
https://support.intelrealsense.com/hc/en-us/community/posts/1500001255362
Please sign in to leave a comment.
Comments
1 comment