summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-01 13:02:36 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-01 13:02:36 (GMT)
commit0533cd3a773952490eb0e5686afb7b235799a13f (patch)
treea1f14fe42a51499666921d58a6a5b62f1f916d8e /src/script/api/qscriptengine.cpp
parent9c132451acc7fbed1611fd3676cceb26e815f50d (diff)
parente5974b024828578945bd4c349f5f87f82a635225 (diff)
downloadQt-0533cd3a773952490eb0e5686afb7b235799a13f.zip
Qt-0533cd3a773952490eb0e5686afb7b235799a13f.tar.gz
Qt-0533cd3a773952490eb0e5686afb7b235799a13f.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: mkspecs/features/symbian/application_icon.prf src/sql/drivers/odbc/qsql_odbc.cpp
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r--src/script/api/qscriptengine.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 004e3a5..e3291e0 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -1022,6 +1022,7 @@ QScriptEnginePrivate::~QScriptEnginePrivate()
while (!ownedAgents.isEmpty())
delete ownedAgents.takeFirst();
+ detachAllRegisteredScriptPrograms();
detachAllRegisteredScriptValues();
detachAllRegisteredScriptStrings();
qDeleteAll(m_qobjectData);
@@ -1576,6 +1577,14 @@ bool QScriptEnginePrivate::scriptDisconnect(JSC::JSValue signal, JSC::JSValue re
#endif
+void QScriptEnginePrivate::detachAllRegisteredScriptPrograms()
+{
+ QSet<QScriptProgramPrivate*>::const_iterator it;
+ for (it = registeredScriptPrograms.constBegin(); it != registeredScriptPrograms.constEnd(); ++it)
+ (*it)->detachFromEngine();
+ registeredScriptPrograms.clear();
+}
+
void QScriptEnginePrivate::detachAllRegisteredScriptValues()
{
QScriptValuePrivate *it;