Properly shut down the interpreter when the Script object is being destroyed.

This commit is contained in:
Gunnar Beutner 2013-02-14 18:59:47 +01:00
parent 8e672167dc
commit 2485a04694
2 changed files with 7 additions and 0 deletions

View File

@ -32,6 +32,12 @@ Script::Script(const Dictionary::Ptr& properties)
: DynamicObject(properties) : DynamicObject(properties)
{ } { }
Script::~Script(void)
{
if (m_Interpreter)
m_Interpreter->Stop();
}
void Script::OnInitCompleted(void) void Script::OnInitCompleted(void)
{ {
SpawnInterpreter(); SpawnInterpreter();

View File

@ -37,6 +37,7 @@ public:
typedef weak_ptr<Script> WeakPtr; typedef weak_ptr<Script> WeakPtr;
Script(const Dictionary::Ptr& properties); Script(const Dictionary::Ptr& properties);
~Script(void);
String GetLanguage(void) const; String GetLanguage(void) const;
String GetCode(void) const; String GetCode(void) const;