summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/luascript.cc8
-rw-r--r--server/src/luascript.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/server/src/luascript.cc b/server/src/luascript.cc
index 22b0e94..511ba91 100644
--- a/server/src/luascript.cc
+++ b/server/src/luascript.cc
@@ -151,6 +151,14 @@ LUAScript::LUAScript()
L = NULL;
}
+LUAScript::~LUAScript()
+{
+ if(L) {
+ lua_close(L);
+ L = NULL;
+ }
+}
+
void LUAScript::init()
throw(Exception)
{
diff --git a/server/src/luascript.h b/server/src/luascript.h
index 11fb77d..eee6f46 100644
--- a/server/src/luascript.h
+++ b/server/src/luascript.h
@@ -55,7 +55,7 @@ public:
};
LUAScript();
- virtual ~LUAScript() {}
+ virtual ~LUAScript();
virtual const char *name() { return ""; }