Job #19766 BUG: Stop or reload all scripts crashes interface fixed.

QUrl(name).toString() does not equal name, therefore removing name from
ScriptEngineHash was failing, and a dangling pointer was left in the
script engine hash map.
This commit is contained in:
matsukaze 2014-06-09 17:52:50 -04:00
parent a8d504fc81
commit c8c8bccbf3

View file

@ -3494,7 +3494,7 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript
// start the script on a new thread...
QUrl scriptUrl(scriptName);
scriptEngine = new ScriptEngine(scriptUrl, &_controllerScriptingInterface);
_scriptEnginesHash.insert(scriptName, scriptEngine);
_scriptEnginesHash.insert(scriptUrl.toString(), scriptEngine);
if (!scriptEngine->hasScript()) {
qDebug() << "Application::loadScript(), script failed to load...";