mirror of https://github.com/CGAL/cgal
Merge pull request #7504 from lrineau/Polyhedron_demo-fix_memory_leaks-GF
fix various memory leaks in CGAL Lab
This commit is contained in:
commit
97bd67d78e
|
|
@ -27,6 +27,11 @@ Point_container::Point_container(int program, bool indexed)
|
|||
|
||||
}
|
||||
|
||||
Point_container::~Point_container()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
void Point_container::initGL(Viewer_interface *viewer)
|
||||
{
|
||||
viewer->makeCurrent();
|
||||
|
|
@ -64,7 +69,6 @@ void Point_container::initGL(Viewer_interface *viewer)
|
|||
setVbo(Colors,
|
||||
new Vbo("colors",
|
||||
Vbo::COLORS));
|
||||
setVao(viewer, new Vao(viewer->getShaderProgram(getProgram())));
|
||||
if(viewer->getShaderProgram(getProgram())->property("hasNormals").toBool())
|
||||
{
|
||||
if(!getVbo(Normals))
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ struct DEMO_FRAMEWORK_EXPORT Point_container :public Primitive_container
|
|||
//!
|
||||
Point_container(int program, bool indexed);
|
||||
|
||||
~Point_container();
|
||||
|
||||
//!
|
||||
//! \brief initGL creates the `Vbo`s and `Vao`s of this `Point_container`.
|
||||
//! \attention It must be called within a valid OpenGL context. The `draw()` function of an item is always a safe place to call this.
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
#include <CGAL/Three/Viewer_interface.h>
|
||||
#include <CGAL/Three/Scene_item_rendering_helper.h>
|
||||
|
||||
#include <memory> // for std::unique_ptr
|
||||
|
||||
using namespace CGAL::Three;
|
||||
|
||||
#ifdef demo_framework_EXPORTS
|
||||
|
|
@ -248,7 +250,7 @@ public:
|
|||
//!
|
||||
private:
|
||||
friend struct D;
|
||||
mutable D* d;
|
||||
std::unique_ptr<D> d;
|
||||
}; //end of class Triangle_container
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue