library init: be recursive
authorAlexander Klauer <Alexander.Klauer@itwm.fraunhofer.de>
Thu, 14 Mar 2013 14:26:14 +0000 (15:26 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 22 Apr 2013 21:24:50 +0000 (23:24 +0200)
commit2e0c3076e592d0d8ec4878aa800f24601f0a7321
tree4f2b0eb568f5d36bbfc67995dc9a3345c23643bf
parent148c8e0353d93d7c00003da5a0b8eda2079bc8b9
library init: be recursive

Previously, a single call to ares_library_cleanup() would deinitialise
the c-ares library, regardless of how many times ares_library_init() was
called. This behaviour may cause problems in programs linking two or
more libraries which, in turn, use c-ares. The present commit fixes this
problem, deinitializing the library only after a number of calls to
ares_library_cleanup() matching the number of calls to
ares_library_init().
ares_library_init.c