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)
|
||||
{
|
||||
m_shadow_FBO = NULL;
|
||||
initGL();
|
||||
using namespace video;
|
||||
using namespace core;
|
||||
@ -197,14 +198,14 @@ RTT::RTT(size_t width, size_t height)
|
||||
|
||||
somevector.clear();
|
||||
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);
|
||||
}
|
||||
|
||||
RTT::~RTT()
|
||||
{
|
||||
delete shadowFBO;
|
||||
delete m_shadow_FBO;
|
||||
glDeleteTextures(RTT_COUNT, RenderTargetTextures);
|
||||
glDeleteTextures(1, &DepthStencilTexture);
|
||||
if (irr_driver->getGLSLVersion() >= 150)
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
RTT(size_t width, size_t height);
|
||||
~RTT();
|
||||
|
||||
FrameBuffer &getShadowFBO() { return *shadowFBO; }
|
||||
FrameBuffer &getShadowFBO() { return *m_shadow_FBO; }
|
||||
unsigned getShadowDepthTex() const { return shadowDepthTex; }
|
||||
|
||||
unsigned getDepthStencilTexture() const { return DepthStencilTexture; }
|
||||
@ -49,7 +49,7 @@ private:
|
||||
unsigned DepthStencilTexture;
|
||||
|
||||
unsigned shadowColorTex, shadowDepthTex;
|
||||
FrameBuffer* shadowFBO;
|
||||
FrameBuffer* m_shadow_FBO;
|
||||
|
||||
LEAK_CHECK();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user