summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opengl/qglbuffer.cpp4
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;