QEasingCurve: fix mem leak in operator>>
The code ignored that the QEasingCurve passed in to op>> might already have a QEasingCurveFunction set, overwriting it with a new pointer without deleting the old. Change-Id: Ic14cf7e4b97c7c8c7edb64cde08fbf22c07ac8f3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
665966d243
commit
9dcc38b566
@ -1497,6 +1497,8 @@ QDataStream &operator>>(QDataStream &stream, QEasingCurve &easing)
|
||||
|
||||
bool hasConfig;
|
||||
stream >> hasConfig;
|
||||
delete easing.d_ptr->config;
|
||||
easing.d_ptr->config = Q_NULLPTR;
|
||||
if (hasConfig) {
|
||||
QEasingCurveFunction *config = curveToFunctionObject(type);
|
||||
stream >> config->_p;
|
||||
|
Loading…
Reference in New Issue
Block a user