diff options
author | Vadim Zakondyrin <thekondr@crystalnix.com> | 2012-11-17 10:39:14 +0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-19 23:21:13 +0100 |
commit | adf4e54742617489d303a711c7b3fcc3086e3a1d (patch) | |
tree | 1e9e2fcafb662c31d63f7d984329139b4abf840c /src | |
parent | 15f1fe587d35cb3a10ce7e24b8572c6483e4ea34 (diff) |
Fixed memory leak in assign operator of QGLBuffer
Change-Id: Icb51dd5a567483b415ab0e8af9eb62221225890d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-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 5e503d9985..acb13d69f5 100644 --- a/src/opengl/qglbuffer.cpp +++ b/src/opengl/qglbuffer.cpp @@ -211,8 +211,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; |