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