mirror of
https://github.com/allankoechke/soci.git
synced 2026-11-29 09:33:26 +00:00
There were multiple problems with calling unload_all() from the static object destructor: 1. Under Windows, this is explicitly disallowed when the destructor is executed under the global loader lock, which is the case when SOCI is built as a shared library, so never do it there. 2. Under Unix, this could result in unloading the core library itself, containing unload_all() code, if SOCI core was dynamically loaded using dlopen() or was linked in a usual way into another shared library which was loading with dlopen(), i.e. any kind of plugin. Fix this by simply not trying to unload the backends automatically from a global object destructor and document that unload_all() must be called if it is really important to unload them. Also mention unload(), which previously didn't appear in the documentation at all, just like unload_all().