summaryrefslogtreecommitdiff
path: root/lib/BLua.cc
diff options
context:
space:
mode:
authorpixel <pixel>2007-05-30 22:36:31 +0000
committerpixel <pixel>2007-05-30 22:36:31 +0000
commita0473d37f726f7bedbdeea511a6cc53744cb1ef6 (patch)
tree1810b6524f1f696081af85ed3f557c0f8ca525e7 /lib/BLua.cc
parentd12ead8fae75e5ad38676e084317516831e6214c (diff)
Trying to work around a spawn-Domain-from-thread issue, but doesn't really seem to fix it.
Diffstat (limited to 'lib/BLua.cc')
-rw-r--r--lib/BLua.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/BLua.cc b/lib/BLua.cc
index d65b553..ac1f8e8 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.47 2007-05-30 11:57:09 pixel Exp $ */
+/* $Id: BLua.cc,v 1.48 2007-05-30 22:36:31 pixel Exp $ */
#include <stdlib.h>
#include "BLua.h"
@@ -402,6 +402,8 @@ Lua::Lua() : L(lua_open()), _protected(false), _is_thread(false) {
push("BLUA_THREADS");
newtable();
settable(LUA_REGISTRYINDEX);
+
+ father = 0;
}
Lua::Lua(lua_State * __L) : L(__L), _protected(false), _is_thread(true) {
@@ -413,8 +415,13 @@ Lua::Lua(lua_State * __L) : L(__L), _protected(false), _is_thread(true) {
}
+Lua * Lua::Father() {
+ return father ? father : this;
+}
+
Lua * Lua::spawn_from_thread(lua_State * __L) {
- return new Lua(__L);
+ Lua * L = new Lua(__L);
+ L->father = Father();
}
Lua::~Lua() {