aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-01-15 23:55:53 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-01-15 23:55:53 +0000
commit4c35a40858db71daa0f6be4111c620fb201f245a (patch)
tree1107ae836fbf51f066d45363103b278de81c8636 /lib
parent802b2aaf6a5e640b868dc47b53df13a7d931cc5e (diff)
Bryan Henderson turned the 'initialized' variable for curl_global_init()
into a counter, and thus you can now do multiple curl_global_init() and you are then supposed to do the same amount of calls to curl_global_cleanup(). Bryan also updated the docs accordingly.
Diffstat (limited to 'lib')
-rw-r--r--lib/easy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/easy.c b/lib/easy.c
index 80fd764c5..2de18037f 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -190,7 +190,7 @@ curl_calloc_callback Curl_ccalloc = (curl_calloc_callback)calloc;
*/
CURLcode curl_global_init(long flags)
{
- if (initialized)
+ if (initialized++)
return CURLE_OK;
/* Setup the default memory functions here (again) */
@@ -217,7 +217,6 @@ CURLcode curl_global_init(long flags)
idna_init();
#endif
- initialized = 1;
init_flags = flags;
return CURLE_OK;
@@ -263,6 +262,9 @@ void curl_global_cleanup(void)
if (!initialized)
return;
+ if (--initialized)
+ return;
+
Curl_global_host_cache_dtor();
if (init_flags & CURL_GLOBAL_SSL)
@@ -275,7 +277,6 @@ void curl_global_cleanup(void)
amiga_cleanup();
#endif
- initialized = 0;
init_flags = 0;
}