Merge pull request #2440 from ZappoMan/fixagentcrash

fix crash on domain restart in Agent, also have Agent properly shutdown on call to Script.stop()
This commit is contained in:
Stephen Birarda 2014-03-21 16:04:44 -07:00
commit 5fa26ee00c
2 changed files with 7 additions and 0 deletions

View file

@ -189,4 +189,9 @@ void Agent::run() {
_scriptEngine.setScriptContents(scriptContents);
_scriptEngine.run();
setFinished(true);
}
void Agent::aboutToFinish() {
_scriptEngine.stop();
}

View file

@ -41,6 +41,8 @@ public:
bool isListeningToAudioStream() const { return _scriptEngine.isListeningToAudioStream(); }
void setIsListeningToAudioStream(bool isListeningToAudioStream)
{ _scriptEngine.setIsListeningToAudioStream(isListeningToAudioStream); }
virtual void aboutToFinish();
public slots:
void run();