summaryrefslogtreecommitdiffstats
path: root/src/script/api
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2010-03-26 12:59:26 (GMT)
committerKent Hansen <kent.hansen@nokia.com>2010-03-26 15:16:49 (GMT)
commit61b488a965eebc52104243dce21eaeb203cfecae (patch)
treec7370f9f384a9a89c5fa5f269a74f30833399ece /src/script/api
parent6829ee30f02f162bbb399000c853c8d680f8f8de (diff)
downloadQt-61b488a965eebc52104243dce21eaeb203cfecae.zip
Qt-61b488a965eebc52104243dce21eaeb203cfecae.tar.gz
Qt-61b488a965eebc52104243dce21eaeb203cfecae.tar.bz2
QtScript: Make sure the old identifier table is restored
Use a shim to take care of that.
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptengine.cpp2
-rw-r--r--src/script/api/qscriptengine_p.h1
-rw-r--r--src/script/api/qscriptstring.cpp6
3 files changed, 6 insertions, 3 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index b322523..a393ead 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -915,7 +915,7 @@ QScriptEnginePrivate::QScriptEnginePrivate()
QScriptEnginePrivate::~QScriptEnginePrivate()
{
- JSC::setCurrentIdentifierTable(globalData->identifierTable);
+ QScript::APIShim shim(this);
//disconnect all loadedScripts and generate all jsc::debugger::scriptUnload events
QHash<intptr_t,QScript::UStringSourceProviderWithFeedback*>::const_iterator it;
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 70ab7c9..5c2007f 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -798,7 +798,6 @@ inline void QScriptEnginePrivate::unregisterScriptString(QScriptStringPrivate *v
registeredScriptStrings = value->next;
value->prev = 0;
value->next = 0;
- JSC::setCurrentIdentifierTable(globalData->identifierTable);
}
inline QScriptContext *QScriptEnginePrivate::contextForFrame(JSC::ExecState *frame)
diff --git a/src/script/api/qscriptstring.cpp b/src/script/api/qscriptstring.cpp
index 7978b61..d0b0ffd 100644
--- a/src/script/api/qscriptstring.cpp
+++ b/src/script/api/qscriptstring.cpp
@@ -92,8 +92,12 @@ QScriptString::~QScriptString()
d->ref.ref(); // avoid deletion
break;
case QScriptStringPrivate::HeapAllocated:
- if (d->engine && (d->ref == 1))
+ if (d->engine && (d->ref == 1)) {
+ // Make sure the identifier is removed from the correct engine.
+ QScript::APIShim(d->engine);
+ d->identifier = JSC::Identifier();
d->engine->unregisterScriptString(d);
+ }
break;
}
}