diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-06-21 10:56:00 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-06-23 12:34:51 +0200 |
commit | 714d9d95484907378b46292df7aec0832f557f1d (patch) | |
tree | a2fa6446a723bcb79d68cfcb3d5dd715ccc9b084 /src/qml/qml/qqmlcomponent_p.h | |
parent | fca40e7cf81338e4c22ef25fa0b3fe0f691632b7 (diff) |
Fix memory leak in QQmlComponent::createObject
Regression introduced with 5.3.0. Prevent the leak of the object creator
on repeated createObject calls by using a scoped pointer.
Change-Id: Ib4fe7c9c6926c2390f7ae78f3287bb7da5f60527
Task-number: QTBUG-39742
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcomponent_p.h')
-rw-r--r-- | src/qml/qml/qqmlcomponent_p.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlcomponent_p.h b/src/qml/qml/qqmlcomponent_p.h index e8ae540148..2c70d7b100 100644 --- a/src/qml/qml/qqmlcomponent_p.h +++ b/src/qml/qml/qqmlcomponent_p.h @@ -106,15 +106,13 @@ public: struct ConstructionState { ConstructionState() - : creator(0) - , completePending(false) + : completePending(false) {} ~ConstructionState() { - delete creator; } - QQmlObjectCreator *creator; + QScopedPointer<QQmlObjectCreator> creator; QList<QQmlError> errors; bool completePending; }; |