Skip to content

Commit

Permalink
Avoid broken registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
kunitoki committed Sep 27, 2024
1 parent ec16b7d commit 1f2905c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/LuaBridge/detail/Namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,12 @@ class Namespace : public detail::Registrar

// Map T back from its stored tables
lua_rawgetp(L, LUA_REGISTRYINDEX, detail::getConstRegistryKey<T>()); // Stack: ns, st, co
LUABRIDGE_ASSERT(lua_istable(L, -1)); // Class was previously registered as table or namespace ?
lua_insert(L, -2); // Stack: ns, co, st
++m_stackSize;

lua_rawgetp(L, LUA_REGISTRYINDEX, detail::getClassRegistryKey<T>()); // Stack: ns, co, st, cl
LUABRIDGE_ASSERT(lua_istable(L, -1)); // Class was previously registered as table or namespace ?
lua_insert(L, -2); // Stack: ns, co, cl, st
++m_stackSize;
}
Expand Down

0 comments on commit 1f2905c

Please sign in to comment.