summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/qscriptstring.cpp')
-rw-r--r--src/script/api/qscriptstring.cpp6
1 files changed, 5 insertions, 1 deletions
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;
}
}