Merge pull request #1504 from Lopuska/patch-16

ResourceLeakFix for OpenGL
This commit is contained in:
Anis 2016-02-15 14:08:44 +01:00
commit 74c189681c
4 changed files with 21 additions and 3 deletions

View file

@ -143,6 +143,11 @@ public:
init();
}
~GLCircularVolatileBuffer()
{
glDeleteBuffers(1, &mBufferName);
}
void init()
{
glGenBuffers(1, &mBufferName);
@ -290,4 +295,4 @@ protected:
};
#endif
#endif

View file

@ -260,7 +260,10 @@ GFXGLTextureTarget::GFXGLTextureTarget() : mCopyFboSrc(0), mCopyFboDst(0)
GFXGLTextureTarget::~GFXGLTextureTarget()
{
GFXTextureManager::removeEventDelegate( this, &GFXGLTextureTarget::_onTextureEvent );
GFXTextureManager::removeEventDelegate(this, &GFXGLTextureTarget::_onTextureEvent);
glDeleteFramebuffers(1, &mCopyFboSrc);
glDeleteFramebuffers(1, &mCopyFboDst);
}
const Point2I GFXGLTextureTarget::getSize()

View file

@ -42,6 +42,14 @@ GFXGLWindowTarget::GFXGLWindowTarget(PlatformWindow *win, GFXDevice *d)
win->appEvent.notify(this, &GFXGLWindowTarget::_onAppSignal);
}
GFXGLWindowTarget::~GFXGLWindowTarget()
{
if(glIsFramebuffer(mCopyFBO))
{
glDeleteFramebuffers(1, &mCopyFBO);
}
}
void GFXGLWindowTarget::resetMode()
{
if(mWindow->getVideoMode().fullScreen != mWindow->isFullscreen())

View file

@ -30,6 +30,8 @@ class GFXGLWindowTarget : public GFXWindowTarget
public:
GFXGLWindowTarget(PlatformWindow *win, GFXDevice *d);
~GFXGLWindowTarget();
const Point2I getSize()
{
return mWindow->getClientExtent();
@ -64,4 +66,4 @@ private:
void _WindowPresent();
};
#endif
#endif