don't leak fpstext texture

BUG: 325610
FIXED-IN: 4.11.3
REVIEW: 113136
This commit is contained in:
Thomas Lübking 2013-10-06 22:58:20 +02:00
parent eb059ad8a6
commit 57cc5e2954
2 changed files with 2 additions and 4 deletions

View file

@ -47,7 +47,6 @@ const int MAX_TIME = 100;
ShowFpsEffect::ShowFpsEffect() ShowFpsEffect::ShowFpsEffect()
: paints_pos(0) : paints_pos(0)
, frames_pos(0) , frames_pos(0)
, fpsText(0)
, m_noBenchmark(effects->effectFrame(EffectFrameUnstyled, false)) , m_noBenchmark(effects->effectFrame(EffectFrameUnstyled, false))
{ {
for (int i = 0; for (int i = 0;
@ -233,8 +232,7 @@ void ShowFpsEffect::paintGL(int fps)
// Paint FPS numerical value // Paint FPS numerical value
if (fpsTextRect.isValid()) { if (fpsTextRect.isValid()) {
delete fpsText; fpsText.reset(new GLTexture(fpsTextImage(fps)));
fpsText = new GLTexture(fpsTextImage(fps));
fpsText->bind(); fpsText->bind();
ShaderBinder binder(ShaderManager::SimpleShader); ShaderBinder binder(ShaderManager::SimpleShader);
if (effects->compositingType() == OpenGL2Compositing) { if (effects->compositingType() == OpenGL2Compositing) {

View file

@ -93,7 +93,7 @@ private:
int x; int x;
int y; int y;
QRect fps_rect; QRect fps_rect;
GLTexture *fpsText; QScopedPointer<GLTexture> fpsText;
int textPosition; int textPosition;
QFont textFont; QFont textFont;
QColor textColor; QColor textColor;