-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
pointcloud processing block causing memory leak #2860
Comments
Hi @mf-bwf |
I have the same problem, and also solve the problem using the same way. |
So, exactly, what is the proper way of avoiding any such memory leak? What is the procedure of destroying processing block? |
Hi, I was wondering if there was any update on this issue? I have found the memory leak even without any #include <librealsense2/rs.hpp>
#include <iostream>
int main()
{
rs2::pipeline pipe;
rs2::config cfg;
cfg.enable_device_from_file(<insert bag file path here>);
pipe.start(cfg);
auto frames = pipe.wait_for_frames();
auto depth = frames.get_depth_frame();
long int i = 0;
while (1)
{
i++;
std::cout << i << std::endl;
frames = pipe.wait_for_frames();
depth = frames.get_depth_frame();
}
} |
Fix is in the |
Issue Description
There seems to be an issue with memory deallocation for rs2::pointcloud
The following minimum example code results in a memory leak.
The memory leak can be made smaller by moving the definition of 'pc' outside of the while loop, keeping the instance alive until function exit.
The text was updated successfully, but these errors were encountered: