src/script/api/qscriptstring.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
--- 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;
         }
     }