[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Calling a function on exit
- From: "D Burgess" <db@...>
- Date: Thu, 10 Jun 2004 19:48:28 +1000
I believe that in the new Luasocket Diego has added WSACleanup(),
however it is up to the user to call it. I use a gc method on
the socket namespace to make sure it gets called.
Wim Couwenberg <firstname.lastname@example.org> wrote:
>> 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...