mirror of https://github.com/CGAL/cgal
fix various memory leaks in CGAL Lab
This commit is contained in:
parent
432d66b613
commit
d1cda5bd31
|
|
@ -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)
|
void Point_container::initGL(Viewer_interface *viewer)
|
||||||
{
|
{
|
||||||
viewer->makeCurrent();
|
viewer->makeCurrent();
|
||||||
|
|
@ -64,7 +69,6 @@ void Point_container::initGL(Viewer_interface *viewer)
|
||||||
setVbo(Colors,
|
setVbo(Colors,
|
||||||
new Vbo("colors",
|
new Vbo("colors",
|
||||||
Vbo::COLORS));
|
Vbo::COLORS));
|
||||||
setVao(viewer, new Vao(viewer->getShaderProgram(getProgram())));
|
|
||||||
if(viewer->getShaderProgram(getProgram())->property("hasNormals").toBool())
|
if(viewer->getShaderProgram(getProgram())->property("hasNormals").toBool())
|
||||||
{
|
{
|
||||||
if(!getVbo(Normals))
|
if(!getVbo(Normals))
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@ struct DEMO_FRAMEWORK_EXPORT Point_container :public Primitive_container
|
||||||
//!
|
//!
|
||||||
Point_container(int program, bool indexed);
|
Point_container(int program, bool indexed);
|
||||||
|
|
||||||
|
~Point_container();
|
||||||
|
|
||||||
//!
|
//!
|
||||||
//! \brief initGL creates the `Vbo`s and `Vao`s of this `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.
|
//! \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/Viewer_interface.h>
|
||||||
#include <CGAL/Three/Scene_item_rendering_helper.h>
|
#include <CGAL/Three/Scene_item_rendering_helper.h>
|
||||||
|
|
||||||
|
#include <memory> // for std::unique_ptr
|
||||||
|
|
||||||
using namespace CGAL::Three;
|
using namespace CGAL::Three;
|
||||||
|
|
||||||
#ifdef demo_framework_EXPORTS
|
#ifdef demo_framework_EXPORTS
|
||||||
|
|
@ -248,7 +250,7 @@ public:
|
||||||
//!
|
//!
|
||||||
private:
|
private:
|
||||||
friend struct D;
|
friend struct D;
|
||||||
mutable D* d;
|
std::unique_ptr<D> d;
|
||||||
}; //end of class Triangle_container
|
}; //end of class Triangle_container
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue