src/script/api/qscriptstring.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
    90         case QScriptStringPrivate::StackAllocated:
    90         case QScriptStringPrivate::StackAllocated:
    91             Q_ASSERT(d->ref == 1);
    91             Q_ASSERT(d->ref == 1);
    92             d->ref.ref(); // avoid deletion
    92             d->ref.ref(); // avoid deletion
    93             break;
    93             break;
    94         case QScriptStringPrivate::HeapAllocated:
    94         case QScriptStringPrivate::HeapAllocated:
    95             if (d->engine && (d->ref == 1))
    95             if (d->engine && (d->ref == 1)) {
       
    96                 // Make sure the identifier is removed from the correct engine.
       
    97                 QScript::APIShim shim(d->engine);
       
    98                 d->identifier = JSC::Identifier();
    96                 d->engine->unregisterScriptString(d);
    99                 d->engine->unregisterScriptString(d);
       
   100             }
    97             break;
   101             break;
    98         }
   102         }
    99     }
   103     }
   100 }
   104 }
   101 
   105