diff --git a/animations/animationscriptengine.cpp b/animations/animationscriptengine.cpp index e42b559ef..08a175b3c 100644 --- a/animations/animationscriptengine.cpp +++ b/animations/animationscriptengine.cpp @@ -196,9 +196,11 @@ bool loadScript(const QString &path, const QString &prefix) QString tmp(buffer.readAll()); QScriptEngine *engine = AnimationScriptEngine::globalEngine(); + engine->pushContext(); s_prefix = prefix; QScriptValue def(engine->evaluate(tmp, path)); s_prefix.clear(); + engine->popContext(); if (engine->hasUncaughtException()) { const QScriptValue error = engine->uncaughtException(); QString file = error.property("fileName").toString();