diff options
author | pixel <pixel> | 2007-07-12 11:28:32 +0000 |
---|---|---|
committer | pixel <pixel> | 2007-07-12 11:28:32 +0000 |
commit | f3dfa53a3efd9a1efabe5d0afca94239cfffffe7 (patch) | |
tree | 023bf4dc54252f5aaa414b552975122d16ea0175 /lib/BLua.cc | |
parent | a03ab6eb2b36f023cb903848196355c71f6a3b52 (diff) |
Last patch seems to work fine - let's try to be a bit nicer with the memory now.
Diffstat (limited to 'lib/BLua.cc')
-rw-r--r-- | lib/BLua.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/BLua.cc b/lib/BLua.cc index 517955b..a33866f 100644 --- a/lib/BLua.cc +++ b/lib/BLua.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: BLua.cc,v 1.50 2007-06-17 15:13:46 pixel Exp $ */ +/* $Id: BLua.cc,v 1.51 2007-07-12 11:28:32 pixel Exp $ */ #include <stdlib.h> #include "BLua.h" @@ -465,6 +465,16 @@ Lua::~Lua() { if (!_is_thread) { lua_setgcthreshold(L, 0); lua_close(L); + } else { + push(); // -1 = nil + push("BLUA_THREADS"); // -2 = nil, -1 = "BLUA_THREADS" + copy(); // -3 = nil, -2 = "BLUA_THREADS", -1 = "BLUA_THREADS" + gettable(LUA_REGISTRYINDEX); // -3 = nil, -2 = "BLUA_THREADS", -1 = BLUA_THREADS + push((lua_Number) IntPoint(Lt)); // -4 = nil, -3 = "BLUA_THREADS", -2 = BLUA_THREADS, -1 = key-Lt + copy(-4); // -5 = nil, -4 = "BLUA_THREADS", -3 = BLUA_THREADS, -2 = key-Lt, -1 = thread + settable(); // -3 = nil, -2 = "BLUA_THREADS", -1 = BLUA_THREADS + settable(LUA_REGISTRYINDEX); // -1 = thread + pop(); } L = 0; |