QMutableEventPoint::detach: deref old private
After detaching, the current QMutableEventPoint obviously doesn't reference old QMutableEventPointPrivate anymore. Deref it, so that we do not leak memory. Change-Id: I3b59667603d41f452eead9a2db13e1d005f622ec Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>bb10
parent
73f9c514dc
commit
1f66d914e4
|
|
@ -479,8 +479,10 @@ void QMutableEventPoint::detach()
|
|||
if (d->refCount == 1)
|
||||
return; // no need: there is only one QEventPoint using it
|
||||
qCDebug(lcEPDetach) << "detaching: refCount" << d->refCount << this;
|
||||
auto old = d;
|
||||
d = new QEventPointPrivate(*d);
|
||||
d->refCount = 1;
|
||||
--old->refCount;
|
||||
}
|
||||
|
||||
/*! \internal
|
||||
|
|
|
|||
Loading…
Reference in New Issue