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 ad42896ef5..b52e4d05ef 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;