diff options
Diffstat (limited to 'src/script/api/qscriptstring.cpp')
-rw-r--r-- | src/script/api/qscriptstring.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/script/api/qscriptstring.cpp b/src/script/api/qscriptstring.cpp index 7978b6188f..d0b0ffd829 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; } } |