lua-users home
lua-l archive

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


> > I suppose that the obvious place to put the call to CloseSTDLIB() is in
> > lua_close(), but the Lua docs say that you don't have to call lua_close().
> >
> > Also, in my port, Lua is supplied as a DLL, so will a call to CloseSTDLIB
> be
> > made in the correct context there, i.e. when an app calls lua_close()
> (which
> > is in a DLL), will it be that app's STDLIB context that is "finalised"?
>
> yah, good point.  I haven't dug into CloseSTDLIB(), but the docs state that
> it deallocates the DLL's "thread-local storage" structure, _reent.

In that case, it sounds as though I ought to do the following:

1. Say that C++ users of the Lua DLL *must* call CloseSTDLIB() (if they use
any I/O).

2. Make the OPX call CloseSTDLIB() just after calling lua_close(), and
require OPL programmers to call LuaClose:() (the OPL equivalent).

3. C programmers (i.e. using STDLIB) needn't worry about it.

Does this sound right?

-- 
http://sc3d.org/rrt/
"Reality is what refuses to disappear when you stop believing in it" -
Philip K. Dick