diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-02-25 12:56:59 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-02-25 12:57:17 +0100 |
commit | 912a1b95a9239ef6bd5e70c931fee0d3c15805e9 (patch) | |
tree | 8770ba50e15a0c2ce42e7e015502ce257f57016b /src | |
parent | 878e096e7dfedc390321e7443e62567980bc6f85 (diff) | |
download | qt-creator-912a1b95a9239ef6bd5e70c931fee0d3c15805e9.tar.gz |
Fixed crash when putting a second root item into a QML file.
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/qmljs/qmljslink.cpp | 3 | ||||
-rw-r--r-- | src/libs/qmljs/qmljsscopebuilder.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index 660d4f7ff7..c94ad265e0 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -49,6 +49,7 @@ void Link::scopeChainAt(Document::Ptr doc, const QList<Node *> &astPath) _context->setLookupMode(Context::QmlLookup); scopeChain.qmlComponentScope.clear(); + componentScopes.insert(doc.data(), &scopeChain.qmlComponentScope); makeComponentChain(doc, &scopeChain.qmlComponentScope, &componentScopes); if (const ObjectValue *typeEnvironment = _context->typeEnvironment(doc.data())) @@ -93,7 +94,7 @@ void Link::makeComponentChain( continue; if (otherDoc->bind()->usesQmlPrototype(bind->rootObjectValue(), _context)) { if (components->contains(otherDoc.data())) { - target->instantiatingComponents += components->value(otherDoc.data()); +// target->instantiatingComponents += components->value(otherDoc.data()); } else { ScopeChain::QmlComponentChain *component = new ScopeChain::QmlComponentChain; components->insert(otherDoc.data(), component); diff --git a/src/libs/qmljs/qmljsscopebuilder.cpp b/src/libs/qmljs/qmljsscopebuilder.cpp index 18c8dcf1b8..9ab4381441 100644 --- a/src/libs/qmljs/qmljsscopebuilder.cpp +++ b/src/libs/qmljs/qmljsscopebuilder.cpp @@ -69,6 +69,8 @@ void ScopeBuilder::setQmlScopeObject(Node *node) const ObjectValue *scopeObject = _doc->bind()->findQmlObject(node); if (scopeObject) { scopeChain.qmlScopeObjects += scopeObject; + } else { + return; // Probably syntax errors, where we're working with a "recovered" AST. } #ifndef NO_DECLARATIVE_BACKEND |