lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



You maybe need to be more precise; exactly which error messages do you get?

One thing I know is if there's multiple Lua core instances in use (i.e. 'lua' executable has the core statically compiled, and 'liblua' has it also, used by modules) this will cause problems on OS X _only_, and the problems will be complaints about malloc/free usage, which is ..hmm.. misleading. Apart from OS X, one also needs to be using multiple Lua states to get into this problem. The solution is simple; to make Lua executable link to liblua; fink distro does this since >= 5.1.1-14.

Another issue is prefering to use 'dlopen()' and not 'NSLoadModule ()', as discussed on the list way back. In other words, LUA_USE_DLOPEN, LUA_USE_POSIX instead of LUA_USE_MACOSX. Also this will require one to do multithreading and Lua to actually matter.

-asko


Wesley Smith kirjoitti 14.1.2008 kello 6:11:

Hi List,
I've been doing some work on a Lua module that contains Cocoa classes
and have run into some nasty crashes on closing the Lua state where
the objc image unloader craps out and spits some double free business
out and/or crashes the app.  I know people have done objc/cocoa lua
modules in the past and I've looked at the luaobjcbridge project from
whom I borrowed a few utility functions.  I've been reading up on
loading/unloading cocoa code dynamically and apparently unloading has
not been supported (and may still not be supported in Leopard). I'm
currently on Tiger.  Does anyone have any experience making cocoa
modules and potentially encountered this problem?

thanks,
wes