[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: gtk+2 and Lua - first sample
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 16 Feb 2005 13:02:25 -0200
> I see one possible major problem with a simple implemetation of the
> level one API. Does it enable crashing the application?
No if it's done carefully. See my libraries for examples. It's easy, really:
you just wrap pointers as userdata and set them to NULL when they're GC'd or
destroyed and check for NULL when they're handed to C.
On the other hand, I've found that it's simpler to bind destroy functions
to __gc methods instead of exporting them to Lua.
Bottom line: Lua has all the mechanism to allow writing bindings that cannot
crash the application. Lua libraries written in C should use them.