2 .\" Copyright 1998 by the Massachusetts Institute of Technology.
3 .\" Copyright (C) 2004-2009 by Daniel Stenberg
5 .\" Permission to use, copy, modify, and distribute this
6 .\" software and its documentation for any purpose and without
7 .\" fee is hereby granted, provided that the above copyright
8 .\" notice appear in all copies and that both that copyright
9 .\" notice and this permission notice appear in supporting
10 .\" documentation, and that the name of M.I.T. not be used in
11 .\" advertising or publicity pertaining to distribution of the
12 .\" software without specific, written prior permission.
13 .\" M.I.T. makes no representations about the suitability of
14 .\" this software for any purpose. It is provided "as is"
15 .\" without express or implied warranty.
17 .TH ARES_LIBRARY_CLEANUP 3 "19 May 2009"
19 ares_library_cleanup \- c-ares library deinitialization
24 .B void ares_library_cleanup(void)
31 .B ares_library_cleanup
32 function uninitializes the c-ares library, freeing all resources
33 previously acquired by \fIares_library_init(3)\fP when the library
36 This function must be called when the program using c-ares will
37 no longer need any c-ares function. Once the program has called
38 \fIares_library_cleanup(3)\fP it shall not make any further call to any
41 This function does not cancel any pending c-ares lookups or requests
42 previously done. Program must use \fIares_cancel(3)\fP for this purpose.
44 .B This function is not thread safe.
45 You have to call it once the program is about to terminate, but this call must
46 be done once the program has terminated every single thread that it could have
47 initiated. This is required to avoid potential race conditions in library
48 deinitialization, and also due to the fact that \fIares_library_cleanup(3)\fP
49 might call functions from other libraries that are thread unsafe, and could
50 conflict with any other thread that is already using these other libraries.
52 Win32/64 application DLLs shall not call \fIares_library_cleanup(3)\fP from
53 the DllMain function. Doing so will produce deadlocks and other problems.
55 This function was first introduced in c-ares version 1.7.0 along with the
56 definition of preprocessor symbol \fICARES_HAVE_ARES_LIBRARY_CLEANUP\fP as an
57 indication of the availability of this function.
59 Since the introduction of this function, it is absolutely mandatory to call it
60 for any Win32/64 program using c-ares.
62 Non-Win32/64 systems can still use c-ares version 1.7.0 without calling
63 \fIares_library_cleanup(3)\fP due to the fact that \fIcurrently\fP it is nearly
64 a do-nothing function on non-Win32/64 platforms.
66 .BR ares_library_init(3),
71 Copyright 1998 by the Massachusetts Institute of Technology.
73 Copyright (C) 2004-2009 by Daniel Stenberg.