diff options
author | Vadim Zakondyrin <thekondr@crystalnix.com> | 2012-11-17 13:25:06 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-17 20:11:38 (GMT) |
commit | d74dbaaa325e5937485a9b3cdcadb55f2ecc111a (patch) | |
tree | afaeea9d190e876e7582d50f2d8b06760babe398 /src/opengl | |
parent | dd95ad45ad228cebd5c067a60859b45e569dca5f (diff) | |
download | Qt-d74dbaaa325e5937485a9b3cdcadb55f2ecc111a.zip Qt-d74dbaaa325e5937485a9b3cdcadb55f2ecc111a.tar.gz Qt-d74dbaaa325e5937485a9b3cdcadb55f2ecc111a.tar.bz2 |
Fixed memory leak in assign operator of QGLBuffer
Change-Id: I90b7e3f352fb7ceea7befabbab7d3b67213dd45f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qglbuffer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp index ad42896..b52e4d0 100644 --- a/src/opengl/qglbuffer.cpp +++ b/src/opengl/qglbuffer.cpp @@ -208,8 +208,10 @@ QGLBuffer &QGLBuffer::operator=(const QGLBuffer &other) { if (d_ptr != other.d_ptr) { other.d_ptr->ref.ref(); - if (!d_ptr->ref.deref()) + if (!d_ptr->ref.deref()) { destroy(); + delete d_ptr; + } d_ptr = other.d_ptr; } return *this; |