24.01.2019 16:14, Adriano dos Santos Fernandes wrote:
On 24/01/2019 12:00, Vlad Khorsun wrote:
24.01.2019 15:13, Jiří Činčura wrote:
Vlad, is it OK to call this method multiple times (nothing else is
called in between)?
Yes. All calls after first one is (almost) no-op
I'm asking because some application might load same library using
different paths via symlinks. And at least Windows (haven't tested
Mac or Linux) is smart enough to load it just once, but I see it from
user as two different paths. Currently there isn't a good xplat way
to resolve symlinks. Thus I might end up calling this twice or more
times.
No problem ;)
It's really problematic, not in the exact situation Jiri explained...
But if we have some libraries in the application loading Firebird, and
the application writer does not have total control of that, two
libraries may load Firebird and when one of them calls the shutdown
function, the other will not work anymore.
Thus fb_shutdown() should be called on *application exit*, not when some
library just want to unload it. In the case when fbclient is loaded and
unloaded many times in the same process it is OK to not call fb_shutdown() -
it will be called implicitly when fbclient is unloaded by the OS.
Explicit call before app exit is recommended to avoid issues with OS loader
lock and to avoid problems when all threads are forcibly terminated due to
process exit.
Regards,
Vlad
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel