QScrollerTimer: fix a memory leak

The QScrollerTimer instance allocated by QScrollerPrivate was never
freed. I've absolutely no idea why QScroller has such a messy
d-pointer handling, so go for the easiest approach: exploit the
fact that QScrollerPrivate is a QObject and parent the QScrollerTimer
to it.

Change-Id: I500edc9d0d14b2fb9eec02712229970eb2b9fe81
Task-number: QTBUG-52280
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
bb10
Giuseppe D'Angelo 2016-03-31 22:12:00 +02:00
parent f805d7075a
commit f84c502433
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ class QScrollTimer : public QAbstractAnimation
{
public:
QScrollTimer(QScrollerPrivate *_d)
: d(_d), ignoreUpdate(false), skip(0)
: QAbstractAnimation(_d), d(_d), ignoreUpdate(false), skip(0)
{ }
int duration() const Q_DECL_OVERRIDE