diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-31 15:46:04 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-31 15:46:04 +0000 |
commit | 96413cb96b8b61c99c1af79991e654bc61f8f247 (patch) | |
tree | 9d6aa8ca8e4c2453a36822c50e9174c3c41ad2d6 /apps | |
parent | 3ede0a35aab6e3faa239373941a85bcbe95ff6ee (diff) |
Move thread-unsafe initializer to the module loading code; add the
corresponding function to the module unload to fix a memory leak.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@46662 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_curl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/app_curl.c b/apps/app_curl.c index 5cf4b167d..93fdd7ff0 100644 --- a/apps/app_curl.c +++ b/apps/app_curl.c @@ -94,7 +94,6 @@ static int curl_internal(struct MemoryStruct *chunk, char *url, char *post) { CURL *curl; - curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if (!curl) { @@ -224,6 +223,7 @@ int unload_module(void) res |= ast_unregister_application(app); STANDARD_HANGUP_LOCALUSERS; + curl_global_cleanup(); return res; } @@ -232,6 +232,7 @@ int load_module(void) { int res; + curl_global_init(CURL_GLOBAL_ALL); res = ast_custom_function_register(&acf_curl); res |= ast_register_application(app, curl_exec, synopsis, descrip); |