summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-06-21 02:18:49 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2011-06-21 03:10:34 (GMT)
commita95814e170643d67a682482b08f574e0f1e9fbf1 (patch)
tree9bbdc8f5067a7c1af4b4ec75fd6c677edc863c09 /src
parentbb11b53bedb8e239b9439b4a3fc3320e35c2de57 (diff)
downloadQt-a95814e170643d67a682482b08f574e0f1e9fbf1.zip
Qt-a95814e170643d67a682482b08f574e0f1e9fbf1.tar.gz
Qt-a95814e170643d67a682482b08f574e0f1e9fbf1.tar.bz2
Fix crash in PropertyChanges.
Don't crash when adding an optimized binding to an object not associated with a QDeclarativeEngine. Change-Id: I4501e21e959380fedfafdc8bc477b330cffbce1b Task-number: QTBUG-19914 Reviewed-by: Aaron Kennedy
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index a5bd604..56361da 100644
--- a/src/declarative/qml/qdeclarativebinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -243,12 +243,13 @@ QDeclarativeBinding::createBinding(Identifier id, QObject *obj, QDeclarativeCont
if (id < 0)
return 0;
+ Q_ASSERT(ctxt);
QDeclarativeContextData *ctxtdata = QDeclarativeContextData::get(ctxt);
- QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(qmlEngine(obj));
+ QDeclarativeEnginePrivate *engine = QDeclarativeEnginePrivate::get(ctxtdata->engine);
QDeclarativeCompiledData *cdata = 0;
QDeclarativeTypeData *typeData = 0;
- if (engine && ctxtdata && !ctxtdata->url.isEmpty()) {
+ if (!ctxtdata->url.isEmpty()) {
typeData = engine->typeLoader.get(ctxtdata->url);
cdata = typeData->compiledData();
}