lua-users home
lua-l archive

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


We've done it with C++ while evaluating the idea of using C++ as a
scripting language as opposed to using a high level language like Lua,
etc. for game scripting purposes. Worked fine in our tests. We
implemented a proxy function CallDLLMethod() that would do all DLL
management (rebuilding, reloading, etc) logic inside and the app doesn't
get to see any of the direct pointers to DLL code or data entries. The
app only gets to use the interface like 

CallDLLMethod(dll_name, method_name, param1, ..., paramN). 

So, I'd imagine the same protocol could be used to unload/reload lua
modules as well... in addition to how  Luiz is proposing to solve this
using upvalues.

AB

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Matt Campbell
Sent: Tuesday, May 02, 2006 12:47 PM
To: lua@bazar2.conectiva.com.br
Subject: Unloadable C libraries


Hello:

Is it possible for a C library dynamically loaded into Lua to be 
unloaded, complete with a call to FreeLibrary or dlclose, without 
closing the Lua state?  If so, what requirements must such a C library 
meet to be safely unloadable?  Thanks.

-- 
Matt Campbell
Lead Programmer
Serotek Corporation
www.freedombox.info
"The Accessibility Anywhere People"