Fixed memory leak in assign operator of QGLBuffer

Change-Id: Icb51dd5a567483b415ab0e8af9eb62221225890d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Vadim Zakondyrin 2012-11-17 10:39:14 +07:00 committed by The Qt Project
parent 15f1fe587d
commit adf4e54742

View File

@ -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;