Skip to content

Commit

Permalink
fix crash when doing Textbox.new()
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Feb 13, 2017
1 parent 6040ccd commit 51eeaf2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lua/LuaLuna.h
Expand Up @@ -122,6 +122,8 @@ template <typename T> class Luna
// push onto the Lua stack a userdata containing a pointer to T object
static int new_T(lua_State * L)
{
if (!lua_gettop(L))
return 0;
lua_remove(L, 1); // use classname:new(), instead of classname.new()

T *obj = new T(L); // call constructor for T objects
Expand Down

0 comments on commit 51eeaf2

Please sign in to comment.