diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-15 13:11:01 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-15 13:11:01 (GMT) |
commit | 5b0bd9a7313d2c92a0c067b28e3ed2a0d32ef922 (patch) | |
tree | a0f8444ea36ce5fdc4d31166e00fbcb51e944859 /src/script | |
parent | 422e26fc3e51e936fc3c00c491b9b512e82236f5 (diff) | |
download | Qt-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.cpp | 6 |
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(); } /*! |