Avoid freeing potentially uninitialised variable.
This commit is contained in:
parent
84235b6491
commit
ebcce3da32
@ -53,6 +53,7 @@ static GLuint generateFBO(GLuint ColorAttachement, GLuint DepthAttachement)
|
|||||||
|
|
||||||
RTT::RTT(size_t width, size_t height)
|
RTT::RTT(size_t width, size_t height)
|
||||||
{
|
{
|
||||||
|
m_shadow_FBO = NULL;
|
||||||
initGL();
|
initGL();
|
||||||
using namespace video;
|
using namespace video;
|
||||||
using namespace core;
|
using namespace core;
|
||||||
@ -197,14 +198,14 @@ RTT::RTT(size_t width, size_t height)
|
|||||||
|
|
||||||
somevector.clear();
|
somevector.clear();
|
||||||
somevector.push_back(shadowColorTex);
|
somevector.push_back(shadowColorTex);
|
||||||
shadowFBO = new FrameBuffer(somevector, shadowDepthTex, 1024, 1024, true);
|
m_shadow_FBO = new FrameBuffer(somevector, shadowDepthTex, 1024, 1024, true);
|
||||||
}
|
}
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
RTT::~RTT()
|
RTT::~RTT()
|
||||||
{
|
{
|
||||||
delete shadowFBO;
|
delete m_shadow_FBO;
|
||||||
glDeleteTextures(RTT_COUNT, RenderTargetTextures);
|
glDeleteTextures(RTT_COUNT, RenderTargetTextures);
|
||||||
glDeleteTextures(1, &DepthStencilTexture);
|
glDeleteTextures(1, &DepthStencilTexture);
|
||||||
if (irr_driver->getGLSLVersion() >= 150)
|
if (irr_driver->getGLSLVersion() >= 150)
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
RTT(size_t width, size_t height);
|
RTT(size_t width, size_t height);
|
||||||
~RTT();
|
~RTT();
|
||||||
|
|
||||||
FrameBuffer &getShadowFBO() { return *shadowFBO; }
|
FrameBuffer &getShadowFBO() { return *m_shadow_FBO; }
|
||||||
unsigned getShadowDepthTex() const { return shadowDepthTex; }
|
unsigned getShadowDepthTex() const { return shadowDepthTex; }
|
||||||
|
|
||||||
unsigned getDepthStencilTexture() const { return DepthStencilTexture; }
|
unsigned getDepthStencilTexture() const { return DepthStencilTexture; }
|
||||||
@ -49,7 +49,7 @@ private:
|
|||||||
unsigned DepthStencilTexture;
|
unsigned DepthStencilTexture;
|
||||||
|
|
||||||
unsigned shadowColorTex, shadowDepthTex;
|
unsigned shadowColorTex, shadowDepthTex;
|
||||||
FrameBuffer* shadowFBO;
|
FrameBuffer* m_shadow_FBO;
|
||||||
|
|
||||||
LEAK_CHECK();
|
LEAK_CHECK();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user