From 2485a0469460aac40168bbe9b75fa5ba989af3bd Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 14 Feb 2013 18:59:47 +0100 Subject: [PATCH] Properly shut down the interpreter when the Script object is being destroyed. --- lib/base/script.cpp | 6 ++++++ lib/base/script.h | 1 + 2 files changed, 7 insertions(+) diff --git a/lib/base/script.cpp b/lib/base/script.cpp index c324f9828..abf1a6c97 100644 --- a/lib/base/script.cpp +++ b/lib/base/script.cpp @@ -32,6 +32,12 @@ Script::Script(const Dictionary::Ptr& properties) : DynamicObject(properties) { } +Script::~Script(void) +{ + if (m_Interpreter) + m_Interpreter->Stop(); +} + void Script::OnInitCompleted(void) { SpawnInterpreter(); diff --git a/lib/base/script.h b/lib/base/script.h index daaf288e1..3cae28e3a 100644 --- a/lib/base/script.h +++ b/lib/base/script.h @@ -37,6 +37,7 @@ public: typedef weak_ptr