diff -r b72c6db6890b -r 5dc02b23752f src/script/api/qscriptstring.cpp --- a/src/script/api/qscriptstring.cpp Wed Jun 23 19:07:03 2010 +0300 +++ b/src/script/api/qscriptstring.cpp Tue Jul 06 15:10:48 2010 +0300 @@ -92,8 +92,12 @@ 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 shim(d->engine); + d->identifier = JSC::Identifier(); d->engine->unregisterScriptString(d); + } break; } }