summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MirLua/src/mlua.cpp')
-rw-r--r--plugins/MirLua/src/mlua.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp
index a389e155f1..e67caf6272 100644
--- a/plugins/MirLua/src/mlua.cpp
+++ b/plugins/MirLua/src/mlua.cpp
@@ -1,6 +1,6 @@
#include "stdafx.h"
-CMLua::CMLua()
+CMLua::CMLua() : L(NULL)
{
L = luaL_newstate();
luaL_openlibs(L);
@@ -24,7 +24,8 @@ CMLua::CMLua()
CMLua::~CMLua()
{
- lua_close(L);
+ if(L)
+ lua_close(L);
}
void CMLua::AddPath(const char *path)