aboutsummaryrefslogtreecommitdiff
path: root/src/lua/thread/luaopen_Thread.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-08-18 14:29:11 +0800
committerchai <chaifix@163.com>2018-08-18 14:29:11 +0800
commit2fb51a71e53b4fc7bd4058d3a5a6f39fa81c345a (patch)
tree973d9e020b5a230d2886c564ef3445e1b654ab2a /src/lua/thread/luaopen_Thread.cpp
parenta68d5cf198a87bb3e14d03dc7347ed52134355d4 (diff)
*update
Diffstat (limited to 'src/lua/thread/luaopen_Thread.cpp')
-rw-r--r--src/lua/thread/luaopen_Thread.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lua/thread/luaopen_Thread.cpp b/src/lua/thread/luaopen_Thread.cpp
index eaa263d..5d44c30 100644
--- a/src/lua/thread/luaopen_Thread.cpp
+++ b/src/lua/thread/luaopen_Thread.cpp
@@ -219,8 +219,7 @@ namespace lua
const char* code = luax_checkstring(L, 2);
Proxy* proxy = (Proxy*)luax_newinstance(L, JIN_THREAD_THREAD, sizeof(Proxy));
Thread* thread = new Thread(name, code, threadRunner);
- Ref<Thread>* ref = new Ref<Thread>(thread);
- proxy->bind(ref, JIN_THREAD_THREAD);
+ proxy->bind(new Ref<Thread>(thread), JIN_THREAD_THREAD);
return 1;
}
@@ -232,8 +231,8 @@ namespace lua
}
static const luaL_Reg f[] = {
- { "Thread", l_newThread},
- { "getThread", l_getThread},
+ { "Thread", l_newThread },
+ { "getThread", l_getThread },
{ 0, 0 }
};