From 57cc5e2954d9adf6bdaecf7fc093201297bf4844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 6 Oct 2013 22:58:20 +0200 Subject: [PATCH] don't leak fpstext texture BUG: 325610 FIXED-IN: 4.11.3 REVIEW: 113136 --- effects/showfps/showfps.cpp | 4 +--- effects/showfps/showfps.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/effects/showfps/showfps.cpp b/effects/showfps/showfps.cpp index 1ab7d57f6d..01bce31c85 100644 --- a/effects/showfps/showfps.cpp +++ b/effects/showfps/showfps.cpp @@ -47,7 +47,6 @@ const int MAX_TIME = 100; ShowFpsEffect::ShowFpsEffect() : paints_pos(0) , frames_pos(0) - , fpsText(0) , m_noBenchmark(effects->effectFrame(EffectFrameUnstyled, false)) { for (int i = 0; @@ -233,8 +232,7 @@ void ShowFpsEffect::paintGL(int fps) // Paint FPS numerical value if (fpsTextRect.isValid()) { - delete fpsText; - fpsText = new GLTexture(fpsTextImage(fps)); + fpsText.reset(new GLTexture(fpsTextImage(fps))); fpsText->bind(); ShaderBinder binder(ShaderManager::SimpleShader); if (effects->compositingType() == OpenGL2Compositing) { diff --git a/effects/showfps/showfps.h b/effects/showfps/showfps.h index 3c30c39be0..27900b8f72 100644 --- a/effects/showfps/showfps.h +++ b/effects/showfps/showfps.h @@ -93,7 +93,7 @@ private: int x; int y; QRect fps_rect; - GLTexture *fpsText; + QScopedPointer fpsText; int textPosition; QFont textFont; QColor textColor;