Fix QBackingStore object leaking
authorLiang Jian <jianliang79@gmail.com>
Mon, 16 Dec 2013 04:17:33 +0000 (12:17 +0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 16 Dec 2013 08:54:22 +0000 (09:54 +0100)
commit9764f8602719676d1fa15e6fd1e7980af16bfc63
tree171a687c92ebb8e6d9c3a33a4e0518cb52069c14
parenta935b3fbd8297e6e2ae6ffdf8ed2790fdf0d46f1
Fix QBackingStore object leaking

Check q->isTopLevel() before calling setBackingStore() in
QWidgetPrivate::create_sys() to prevent QBackingStore leaking. This is
because QWidget::setBackingStore() will return if isTopLevel() is true and
the newly created QBackingStore object will be leaked.

Change-Id: I2777acd4c317d5019f5b266feae005042026b8be
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
src/widgets/kernel/qwidget_qpa.cpp