From 8d4e45c9a85175d0fc37d7d5c49ff90abb01fe4f Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 23 Nov 2018 12:24:22 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9lua=20bind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/time/je_lua_time.cpp | 2 +- src/lua/modules/time/je_lua_timer.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lua/modules/time') diff --git a/src/lua/modules/time/je_lua_time.cpp b/src/lua/modules/time/je_lua_time.cpp index 4eb579f..54ab798 100644 --- a/src/lua/modules/time/je_lua_time.cpp +++ b/src/lua/modules/time/je_lua_time.cpp @@ -33,7 +33,7 @@ namespace JinEngine LUA_IMPLEMENT int l_newTimer(lua_State* L) { - Shared* shrTimer = new Shared(new Timer(), Jin_Lua_Timer); + Shared* shrTimer = new Shared(L, new Timer(), Jin_Lua_Timer); luax_newinstance(L, Jin_Lua_Timer, shrTimer); return 1; } diff --git a/src/lua/modules/time/je_lua_timer.cpp b/src/lua/modules/time/je_lua_timer.cpp index ccb902a..570e537 100644 --- a/src/lua/modules/time/je_lua_timer.cpp +++ b/src/lua/modules/time/je_lua_timer.cpp @@ -44,7 +44,7 @@ namespace JinEngine for(int i = 4; i <= n; ++i) func->pushParam(i); Timer::Handler* handler = shared->every(s, timerCallback, func, finishCallback); - Shared* shrHandler = new Shared(handler, Jin_Lua_Handler); + Shared* shrHandler = new Shared(L, handler, Jin_Lua_Handler); Proxy* proxy = luax_newinstance(L, Jin_Lua_Handler, shrHandler); return 1; } @@ -60,7 +60,7 @@ namespace JinEngine for (int i = 4; i <= n; ++i) func->pushParam(i); Timer::Handler* handler = shared->after(s, timerCallback, func, finishCallback); - Shared* shrHandler = new Shared(handler, Jin_Lua_Handler); + Shared* shrHandler = new Shared(L, handler, Jin_Lua_Handler); Proxy* proxy = luax_newinstance(L, Jin_Lua_Handler, shrHandler); return 1; } @@ -77,7 +77,7 @@ namespace JinEngine for (int i = 5; i <= n; ++i) func->pushParam(i); Timer::Handler* handler = shared->repeat(s, count, timerCallback, func, finishCallback); - Shared* shrHandler = new Shared(handler, Jin_Lua_Handler); + Shared* shrHandler = new Shared(L, handler, Jin_Lua_Handler); Proxy* proxy = luax_newinstance(L, Jin_Lua_Handler, shrHandler); return 1; } -- cgit v1.1-26-g67d0