PDA

View Full Version : dll/so finalization block



{MSX}
29-07-2005, 08:27 AM
Hi! is there a way to put some code on a finalization block for a dll/so ?
Something that gets executed when the program is closed..
thanks!

Sly
29-07-2005, 11:47 AM
http://www.avdf.com/feb96/jkwin32dll.html

Essentially, use the DLLProc variable to point to a procedure that is called when the DLL is unloaded.

{MSX}
29-07-2005, 04:35 PM
Umm i need it working on Linux too.. that seems to work only on win32.. :(

WILL
29-07-2005, 08:04 PM
I'm not sure if thats a built-in capable feature of DLL or SO linkable libraries(considering that the idea is that they are linkable to any other program) BUT you can always just call a common function at the end of each program that uses the DLL/SO or if you have an initialize/finalize(deinitialize) set of functions for your libraries then you can simply include a call to this function in your deinit code.

Interesting idea though.... :)

{MSX}
30-07-2005, 08:40 AM
The problem is that i'm not writing the programs that uses my so, it's already done by thirds.
I'll try including a unit and using it's finalization block :P nice idea!