diff options
author | Vadim Zakondyrin <thekondr@crystalnix.com> | 2012-11-17 10:10:51 +0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-19 23:21:13 +0100 |
commit | 15f1fe587d35cb3a10ce7e24b8572c6483e4ea34 (patch) | |
tree | cd206d4a3bb4616d7c33d1fb9cf9aaa5f762833e /src/gui/opengl/qopenglbuffer.cpp | |
parent | da90a3a490b452154391676857ac2ffc269d4843 (diff) |
Fixed memory leak in assign operator of QOpenGLBuffer
Change-Id: I47f9128b54770bae7a63f82bf66ca16144b67c55
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui/opengl/qopenglbuffer.cpp')
-rw-r--r-- | src/gui/opengl/qopenglbuffer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglbuffer.cpp b/src/gui/opengl/qopenglbuffer.cpp index f84bbcbaa5..11c85f8f25 100644 --- a/src/gui/opengl/qopenglbuffer.cpp +++ b/src/gui/opengl/qopenglbuffer.cpp @@ -209,8 +209,10 @@ QOpenGLBuffer &QOpenGLBuffer::operator=(const QOpenGLBuffer &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; |