[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Calling a function on exit
- From: "Wim Couwenberg" <wcou@...>
- Date: Thu, 10 Jun 2004 09:49:37 +0200
> A clean way to do that
> is to create a userdata (it will look like a Lua object) which exports
> your functions (its methods) and define a metatable for it. The __gc
> field of the metatable could store a function that calls SDL_Quit.
Also in this category: LuaSocket does not automatically call WSACleanup
(Win32) on exit. Failing to do so leads to serious problems on Win32. So
either it should be documented to call WSACleanup manually (maybe not so
nice in dynamic loading scenario's?) or something like Tomas suggested
should be implemented. LuaSocket works great by the way, it just took us a
while to identify this issue...