summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptprogram_p.h
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2011-01-28 09:10:31 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-01-31 13:14:38 (GMT)
commit307eceb786d3558b604c25353d67aed6ef9b0702 (patch)
tree64dde4977c8fd3f5000676d03444c16314f2ccca /src/script/api/qscriptprogram_p.h
parent884dc710553c44277504245dc908f96731da84ed (diff)
downloadQt-307eceb786d3558b604c25353d67aed6ef9b0702.zip
Qt-307eceb786d3558b604c25353d67aed6ef9b0702.tar.gz
Qt-307eceb786d3558b604c25353d67aed6ef9b0702.tar.bz2
Invalidate QScriptPrograms when engine is destroyed
If the engine is destroyed before the program, the program must be invalidated; otherwise the program destructor will access a stale engine pointer, which can cause a crash (it crashes on Symbian, but "only" gives a Valgrind warning on Linux for our autotests). We need to keep track of all associated programs, just like we already do for values and strings. This fix follows the exact same pattern, but uses a QSet to keep the patch minimal. No new tests, but the evaluateProgram() test runs successfully on Symbian now, and there are no more Valgrind warnings. Task-number: QTBUG-16987 Reviewed-by: Olivier Goffart (cherry picked from commit b127b1036ec75c625920a6c029b64a95e3702bf9)
Diffstat (limited to 'src/script/api/qscriptprogram_p.h')
-rw-r--r--src/script/api/qscriptprogram_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/script/api/qscriptprogram_p.h b/src/script/api/qscriptprogram_p.h
index d2fd234..e7809ab 100644
--- a/src/script/api/qscriptprogram_p.h
+++ b/src/script/api/qscriptprogram_p.h
@@ -61,6 +61,7 @@ public:
JSC::EvalExecutable *executable(JSC::ExecState *exec,
QScriptEnginePrivate *engine);
+ void detachFromEngine();
QBasicAtomicInt ref;