diff options
author | Robert Griebl <robert.griebl@pelagicore.com> | 2017-04-19 14:18:06 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2017-04-19 12:32:25 +0000 |
commit | 6a8a7e60ab91f958a1dd63e787a23f6e09f463b1 (patch) | |
tree | dac5ff57207884d558ae0a44cebad95b70b87299 /src/qml | |
parent | 49fa5d9b6915cba4264b090ff0ee98e5b5c5eac8 (diff) |
Fix for dangling object pointers in QQmlErrors
This rarely happens - only seen with Delegates - when
- an object is created during incubation
- some error occurs in this object
- the object gets deleted before the incubation run finishes
Because the errors are delivered after the incubation run finished, the
object() pointer of QQmlError is now a dangling pointer that will crash
your application if accessed.
Change-Id: Idd9fccbc58e4ada67bde3ca1aeec736aa9374789
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlerror.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlerror.cpp b/src/qml/qml/qqmlerror.cpp index 7a1e02eec6..64f008cd32 100644 --- a/src/qml/qml/qqmlerror.cpp +++ b/src/qml/qml/qqmlerror.cpp @@ -44,6 +44,7 @@ #include <QtCore/qfile.h> #include <QtCore/qstringlist.h> #include <QtCore/qvector.h> +#include <QtCore/qpointer.h> #include <private/qv4errorobject_p.h> @@ -86,7 +87,7 @@ public: quint16 line; quint16 column; QtMsgType messageType; - QObject *object; + QPointer<QObject> object; }; QQmlErrorPrivate::QQmlErrorPrivate() |