summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptvalueiterator.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-03-29 15:36:02 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-03-29 17:14:59 (GMT)
commit3e5745ea75d73869918889cb374c3d651bed0991 (patch)
treea67c644259d542131353a3ed68f83b32d3d3fb1c /src/script/api/qscriptvalueiterator.cpp
parent9e3304246acf5b58a2ce86eed082784da818a8f0 (diff)
downloadQt-3e5745ea75d73869918889cb374c3d651bed0991.zip
Qt-3e5745ea75d73869918889cb374c3d651bed0991.tar.gz
Qt-3e5745ea75d73869918889cb374c3d651bed0991.tar.bz2
QScriptEngine: Fix reentrency involving creation and desctructions of QScriptEngines
the currentIdentifierTable table, which is a static thread local variable, could be corrupted. The main change is to fix the QScriptEngine constructor not to alter the currentIdentifierTable This showed a lot of cases where APIShim guards where missings. The problem was seen with creator, related to QTBUG-9426 Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'src/script/api/qscriptvalueiterator.cpp')
-rw-r--r--src/script/api/qscriptvalueiterator.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/script/api/qscriptvalueiterator.cpp b/src/script/api/qscriptvalueiterator.cpp
index 7fd7093..460dddb 100644
--- a/src/script/api/qscriptvalueiterator.cpp
+++ b/src/script/api/qscriptvalueiterator.cpp
@@ -85,6 +85,17 @@ public:
: initialized(false)
{}
+ ~QScriptValueIteratorPrivate()
+ {
+ if (!initialized)
+ return;
+ QScriptEnginePrivate *eng_p = engine();
+ if (!eng_p)
+ return;
+ QScript::APIShim shim(eng_p);
+ propertyNames.clear(); //destroying the identifiers need to be done under the APIShim guard
+ }
+
QScriptValuePrivate *object() const
{
return QScriptValuePrivate::get(objectValue);