Memory leak when we use "vis.CreateVisualizerWindow" and "vis.CaptureDepthFloatBuffer"
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [x] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [x] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [x] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).
### My Question
Hello.
I tested below code and found that there was a memory leak when we use "vis.CreateVisualizerWindow" and "vis.CaptureDepthFloatBuffer"
I really don't know why.... please help me.
```
#include "open3d/Open3D.h"
int main() {
open3d::geometry::TriangleMesh mesh;
std::string filePath = getExecutablePath() + "/data/3wayvv.stl";
open3d::io::ReadTriangleMesh(filePath, mesh);
while (1) {
auto cam = open3d::camera::PinholeCameraParameters();
cam.intrinsic_ = open3d::camera::PinholeCameraIntrinsic(1280, 720, 925.645203, 923.146912, 639.5, 359.5);
cam.extrinsic_ = Eigen::MatrixXd::Identity(4, 4);
open3d::geometry::TriangleMesh mesh = mesh;
Eigen::MatrixXd zz(4, 4);
zz << -0.169771, 0.947726, -0.270174, 20.9914,
-0.106152, -0.290145, -0.951077, 57.288,
-0.97975, -0.132786, 0.149861, 679.271,
0, 0, 0, 1;
mesh.Transform(zz);
auto ptr = std::make_shared(mesh);
auto vis = open3d::visualization::Visualizer();
vis.CreateVisualizerWindow("open3d", 1280, 720, 0, 0, false); // memory leak
vis.AddGeometry({ ptr });
vis.GetViewControl().SetConstantZNear(0);
vis.GetViewControl().SetConstantZFar(5000);
vis.GetViewControl().ConvertFromPinholeCameraParameters(cam);
vis.PollEvents();
vis.UpdateRender();
auto depth = vis.CaptureDepthFloatBuffer(false); // memory leak
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.