diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2009-09-15 12:28:41 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2009-09-15 12:28:41 (GMT) |
commit | 6ce895506320be6b61169cca9243302b91a0cda6 (patch) | |
tree | 90dce9b3dda53930409df071d3c7552eadf66124 /src/declarative/qml | |
parent | 2795a73158280ddce4eec57c643d367bb402a03d (diff) | |
download | Qt-6ce895506320be6b61169cca9243302b91a0cda6.zip Qt-6ce895506320be6b61169cca9243302b91a0cda6.tar.gz Qt-6ce895506320be6b61169cca9243302b91a0cda6.tar.bz2 |
Do not crash in QmlInfo if debugging information is missing
Properly initialize the members of QmlDeclarativeData, and check
whether outerContext has been set in QmlInfo.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 3 | ||||
-rw-r--r-- | src/declarative/qml/qmlinfo.cpp | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index e3d4840..3cf7e69 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -648,7 +648,8 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre } QmlDeclarativeData::QmlDeclarativeData(QmlContext *ctxt) -: context(ctxt), bindings(0), deferredComponent(0), attachedProperties(0) +: context(ctxt), bindings(0), outerContext(0), lineNumber(0), columnNumber(0), deferredComponent(0), + deferredIdx(0), attachedProperties(0) { } diff --git a/src/declarative/qml/qmlinfo.cpp b/src/declarative/qml/qmlinfo.cpp index e47b4ab..bae1682 100644 --- a/src/declarative/qml/qmlinfo.cpp +++ b/src/declarative/qml/qmlinfo.cpp @@ -85,7 +85,11 @@ QmlInfo::QmlInfo(QObject *object) QmlDeclarativeData *ddata = QmlDeclarativeData::get(object); if (ddata) { QString location = QLatin1String("("); - location += ddata->outerContext->baseUrl().toString(); + if (ddata->outerContext) { + location += ddata->outerContext->baseUrl().toString(); + } else { + location += "unknown"; + } location += QLatin1String(":"); location += QString::number(ddata->lineNumber); location += QLatin1String(":"); |