summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstatemachine_p.h
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-07-02 20:45:49 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-10 06:20:07 +0200
commitba87568655dad3e830e692109b5e571ae78b71a0 (patch)
treec9fb40d7ebdd75d8787794b6ae31f7b7f0ab610f /src/corelib/statemachine/qstatemachine_p.h
parent482205d847a15e2afc7988c1792aaeb37e71505f (diff)
statemachine: Don't crash if property assignment target is deleted
Do like QPropertyAnimation and store the QObject in a QPointer. Purge the assignments list upon state entry and property restore. Change-Id: I54a56885a2905178ab6aa5cf292b3d25c86b7a97 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/corelib/statemachine/qstatemachine_p.h')
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h
index ae5660719f..6159107dc0 100644
--- a/src/corelib/statemachine/qstatemachine_p.h
+++ b/src/corelib/statemachine/qstatemachine_p.h
@@ -60,6 +60,7 @@
#include <QtCore/qlist.h>
#include <QtCore/qmutex.h>
#include <QtCore/qpair.h>
+#include <QtCore/qpointer.h>
#include <QtCore/qset.h>
#include <QtCore/qvector.h>
#include <private/qfreelist_p.h>
@@ -183,7 +184,7 @@ public:
void cancelAllDelayedEvents();
#ifndef QT_NO_PROPERTIES
- typedef QPair<QObject *, QByteArray> RestorableId;
+ typedef QPair<QPointer<QObject>, QByteArray> RestorableId;
QHash<RestorableId, QVariant> registeredRestorables;
void registerRestorable(QObject *object, const QByteArray &propertyName);
void unregisterRestorable(QObject *object, const QByteArray &propertyName);