summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/BLua.cc12
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;