lua-users home
lua-l archive

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


On Jan 27, 2004, at 10:48 PM, Ariel Manzur wrote:

It's a known bug.. the easiest workaround right now is to move any non-userdata (like a number or a string), or any private member to the beginning of the class.. As long as it's not exposed (or not userdata), it won't be able to break your object.. The fix will probably come in the next version; we're still considering options.

Alas, I can't really modify the class, without breaking a lot of things. I don't know what CVS comment I'd put in---"added unused dummy variable to make pet scripting project work" doesn't sound all that professional.

Is there any way I could write a "fake method" that would work? I've done similar things with SWIG, but I only see an option for inline Lua code in the tolua++ docs, not inline C or C++.

Can I somehow tell tolua that I would like to pass the field by value, rather than as a pointer to the actual field value? (I have to read the code more to know how tolua handles memory and ownership; what if the object is collected before the field, or the field before the object?)

I suppose I can always write a short method by hand. That may be the best.

Thanks,

-Johann