summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-15 13:11:01 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-15 13:11:01 (GMT)
commit5b0bd9a7313d2c92a0c067b28e3ed2a0d32ef922 (patch)
treea0f8444ea36ce5fdc4d31166e00fbcb51e944859 /src/script
parent422e26fc3e51e936fc3c00c491b9b512e82236f5 (diff)
downloadQt-5b0bd9a7313d2c92a0c067b28e3ed2a0d32ef922.zip
Qt-5b0bd9a7313d2c92a0c067b28e3ed2a0d32ef922.tar.gz
Qt-5b0bd9a7313d2c92a0c067b28e3ed2a0d32ef922.tar.bz2
fix GC-related crash
For some reason our Global Object is not marked by the collector. This fixes the case when you invoke GC explicitly by calling collectGarbage(), but the issue is probably still there when GC is invoked implicitly.
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index c88f464..df31acd 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -3130,9 +3130,11 @@ QStringList QScriptEngine::importedExtensions() const
void QScriptEngine::collectGarbage()
{
Q_D(QScriptEngine);
+ // ### why isn't the global object always marked by the Collector?
+ if (!d->globalObject->marked())
+ d->globalObject->mark();
JSC::JSLock lock(false);
- JSC::ExecState* exec = d->globalObject->globalExec();
- exec->heap()->collect();
+ d->globalData->heap.collect();
}
/*!