Kaydet (Commit) 87e81e4e authored tarafından Takeshi Abe's avatar Takeshi Abe

boost::checked_deleter serves the purpose

Change-Id: I22b4ea752e32b449dcc07b70cc5dc0ba52ad7c45
üst 7e6052f2
......@@ -19,6 +19,7 @@
#include <StaticGeometry.h>
#include "glm/gtc/matrix_inverse.hpp"
#include <boost/checked_delete.hpp>
#define DEBUG_FBO 1
......@@ -840,19 +841,6 @@ void OpenGL3DRenderer::RenderPolygon3D(Polygon3DInfo &polygon)
glUseProgram(0);
}
namespace {
template< typename T >
struct DeletePointer
{
void operator()(T* p)
{
delete p;
}
};
}
void OpenGL3DRenderer::RenderPolygon3DObject()
{
glDepthMask(GL_FALSE);
......@@ -870,9 +858,9 @@ void OpenGL3DRenderer::RenderPolygon3DObject()
RenderPolygon3D(polygon);
}
std::for_each(polygon.verticesList.begin(),
polygon.verticesList.end(), DeletePointer<Vertices3D>());
polygon.verticesList.end(), boost::checked_deleter<Vertices3D>());
std::for_each(polygon.normalsList.begin(),
polygon.normalsList.end(), DeletePointer<Normals3D>());
polygon.normalsList.end(), boost::checked_deleter<Normals3D>());
delete polygon.vertices;
delete polygon.normals;
m_Polygon3DInfoList.pop_front();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment