Fix issue 1527

https://github.com/minetest/minetest/issues/1527
This commit is contained in:
Craig Robbins 2014-07-30 11:39:24 +10:00
parent 8979a3dd99
commit 6ee82c462f
1 changed files with 34 additions and 34 deletions

View File

@ -31,8 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
int LuaVoxelManip::gc_object(lua_State *L) int LuaVoxelManip::gc_object(lua_State *L)
{ {
LuaVoxelManip *o = *(LuaVoxelManip **)(lua_touserdata(L, 1)); LuaVoxelManip *o = *(LuaVoxelManip **)(lua_touserdata(L, 1));
if (!o->is_mapgen_vm) delete o;
delete o;
return 0; return 0;
} }
@ -319,7 +318,8 @@ LuaVoxelManip::LuaVoxelManip(Map *map)
LuaVoxelManip::~LuaVoxelManip() LuaVoxelManip::~LuaVoxelManip()
{ {
delete vm; if (!is_mapgen_vm)
delete vm;
} }
// LuaVoxelManip() // LuaVoxelManip()