diff -r 93b982ccede2 -r 5daf16870df6 src/script/api/qscriptstring.cpp --- a/src/script/api/qscriptstring.cpp Mon Jun 21 22:38:13 2010 +0100 +++ b/src/script/api/qscriptstring.cpp Thu Jul 22 16:41:55 2010 +0100 @@ -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; } }