aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-06-08 14:33:20 +1000
committerAaron Kennedy <aaron.kennedy@nokia.com>2011-06-08 14:33:20 +1000
commit0ad1d429820aae65d1b69813bf354455de3a1669 (patch)
tree09dc104ed3b36f1330d753be908d6b2a702d43d6
parent8902609a7e6cc27fceff15aa80547f1137efd7c9 (diff)
Create a copy of the imported script array handles
This prevents the handles from being double Dispose()'d.
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 5f40c393f9..c7e5bcbe12 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -889,8 +889,11 @@ QObject * QDeclarativeComponentPrivate::begin(QDeclarativeContextData *parentCon
ctxt->imports = component->importCache;
// Nested global imports
- if (componentCreationContext && start != -1)
+ if (componentCreationContext && start != -1) {
ctxt->importedScripts = componentCreationContext->importedScripts;
+ for (int ii = 0; ii < ctxt->importedScripts.count(); ++ii)
+ ctxt->importedScripts[ii] = qPersistentNew<v8::Object>(ctxt->importedScripts[ii]);
+ }
component->importCache->addref();
ctxt->setParent(parentContext);