Fixed memory leak in assign operator of QGLBuffer
Change-Id: Icb51dd5a567483b415ab0e8af9eb62221225890d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
parent
15f1fe587d
commit
adf4e54742
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user