|
On10.04.2012 04:51, James Norton wrote:
I don't think there is any difference how metatables are invoked in this two cases, actually if you didn't declared "line" as local than it is a global as well. I think that the problem lies in the order in which createGlobal and luaopen_display_lib is called. You have to make sure that luaopen_display_lib is called before createGlobal otherwise the luaL_getmetatable in lineSetup will get you a nil value. This would cause the global "Runtime" to have no metatable. If a userdata has no metatable with the function __newindex set you will exactly get the error message you have. -- Thomas |