diff options
-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; |