Hi Juan, > Has anybody there know a solution for this? Don't dlclose the share library until after the destructor of the static object inside g() is destructed. Right now, the code dlclose()s the shared library before the shared library has a chance to clean up its pending atexit destructor of static object. Use the atexit facilities to dlclose the shared library in the proper sequence. HTH, --Eljay