diff options
Diffstat (limited to 'libs/lua/LuaBridge/detail/Namespace.h')
-rw-r--r-- | libs/lua/LuaBridge/detail/Namespace.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/lua/LuaBridge/detail/Namespace.h b/libs/lua/LuaBridge/detail/Namespace.h index e8c02283b5..a8e190da43 100644 --- a/libs/lua/LuaBridge/detail/Namespace.h +++ b/libs/lua/LuaBridge/detail/Namespace.h @@ -984,6 +984,8 @@ private: DATADOC ("Ext C Function", name, fp) assert (lua_istable (L, -1)); lua_pushcclosure (L, fp, 0); + lua_pushvalue (L, -1); + rawsetfield (L, -5, name); // const table rawsetfield (L, -3, name); // class table return *this; } @@ -1320,11 +1322,15 @@ private: set_shared_class (); assert (lua_istable (L, -1)); lua_pushcclosure (L, fp, 0); + lua_pushvalue (L, -1); + rawsetfield (L, -5, name); // const table rawsetfield (L, -3, name); // class table set_weak_class (); assert (lua_istable (L, -1)); lua_pushcclosure (L, fp, 0); + lua_pushvalue (L, -1); + rawsetfield (L, -5, name); // const table rawsetfield (L, -3, name); // class table return *this; |