diff options
author | Michael BrĂ¼ning <michael.bruning@digia.com> | 2014-09-26 15:11:49 +0200 |
---|---|---|
committer | Michael Bruning <michael.bruning@digia.com> | 2014-09-26 15:17:55 +0200 |
commit | 00fbe73457b5040dbbf671b3e85f889240299e2f (patch) | |
tree | 247baf86754112a7ca20b283307416fab4b4da3a /src/core | |
parent | 833e8261264b5eddac030e477ba18a2d62a6bd97 (diff) |
[Win] Use automatic destruction for PbufferGLSurfaceWGL.
PbufferGLSurfaceWGL is a reference counted class, hence deleting
it manually triggers an assert in debug builds if Release is not
called or the reference count is non-zero.
Using a scoped_refptr prevents this and deletes the object
correctly.
Change-Id: I7e5ff783afc367e06d872b8d118c2ff83627b836
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/gl_surface_qt.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp index cc2809af1..bc1b8b399 100644 --- a/src/core/gl_surface_qt.cpp +++ b/src/core/gl_surface_qt.cpp @@ -262,7 +262,7 @@ protected: ~GLSurfaceQtWGL(); private: - PbufferGLSurfaceWGL *m_surfaceBuffer; + scoped_refptr<PbufferGLSurfaceWGL> m_surfaceBuffer; DISALLOW_COPY_AND_ASSIGN(GLSurfaceQtWGL); }; @@ -291,10 +291,7 @@ bool GLSurfaceQtWGL::Initialize() void GLSurfaceQtWGL::Destroy() { - if (m_surfaceBuffer) { - delete m_surfaceBuffer; - m_surfaceBuffer = 0; - } + m_surfaceBuffer = 0; } void *GLSurfaceQtWGL::GetHandle() |