From 00d7ea164e58c0f7a3f4a305bd98cb92dac368a4 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 26 Aug 2014 11:01:29 +0200 Subject: Fix memoryleak. --- server/src/luascript.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'server/src/luascript.cc') 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) { -- cgit v1.2.3