diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2015-10-20 14:30:36 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2015-10-22 12:42:13 +0000 |
commit | 35c1f930295c85a1ce4b257fd05d596d378ccff8 (patch) | |
tree | 6fdeaca26e9148890193f05c6be866f8e269faae /src/qml/qml | |
parent | 8848abe69fa957d5406659229cecdada83da8421 (diff) |
QML: file leak of QFileSelector.
When no "custom" file selector is set, the QQmlFileSelector would not
delete the QFileSelector it created/owned.
Change-Id: I0235d0dabdb8522db0b8b74a2a2d69ee5a20abb6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlfileselector.cpp | 6 | ||||
-rw-r--r-- | src/qml/qml/qqmlfileselector_p.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlfileselector.cpp b/src/qml/qml/qqmlfileselector.cpp index 8597e8a5c7..ab880b7069 100644 --- a/src/qml/qml/qqmlfileselector.cpp +++ b/src/qml/qml/qqmlfileselector.cpp @@ -123,6 +123,12 @@ QQmlFileSelectorPrivate::QQmlFileSelectorPrivate() myInstance.reset(new QQmlFileSelectorInterceptor(this)); } +QQmlFileSelectorPrivate::~QQmlFileSelectorPrivate() +{ + if (ownSelector) + delete selector; +} + /*! Sets the QFileSelector instance for use by the QQmlFileSelector to \a selector. QQmlFileSelector does not take ownership of the new QFileSelector. To reset QQmlFileSelector diff --git a/src/qml/qml/qqmlfileselector_p.h b/src/qml/qml/qqmlfileselector_p.h index 58248bf1c1..46ea027bc1 100644 --- a/src/qml/qml/qqmlfileselector_p.h +++ b/src/qml/qml/qqmlfileselector_p.h @@ -60,6 +60,8 @@ class Q_QML_PRIVATE_EXPORT QQmlFileSelectorPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QQmlFileSelector) public: QQmlFileSelectorPrivate(); + ~QQmlFileSelectorPrivate(); + QFileSelector* selector; QPointer<QQmlEngine> engine; bool ownSelector; |