src/script/api/qscriptstring.cpp
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
--- 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;
         }
     }