aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2013-04-05 13:08:59 +0200
committerKamil Dudka <kdudka@redhat.com>2013-04-05 13:10:41 +0200
commit247b291b12ce0bbb52fbf749542413a60ba7ca84 (patch)
tree8deef4064efac24bc0ae3a1a6aaa67b5db1a5dd6
parente7c56a8406d0d751b8afc1daf2dcbb67c763c465 (diff)
examples/multi-single.c: fix the order of destructions
... so that it adheres to the API documentation. Reported by: Tomas Mlcoch
-rw-r--r--docs/examples/multi-single.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/examples/multi-single.c b/docs/examples/multi-single.c
index aeda71419..37a01cd83 100644
--- a/docs/examples/multi-single.c
+++ b/docs/examples/multi-single.c
@@ -41,6 +41,8 @@ int main(void)
int still_running; /* keep number of running handles */
+ curl_global_init(CURL_GLOBAL_DEFAULT);
+
http_handle = curl_easy_init();
/* set the options (I left out a few, you'll get the point anyway) */
@@ -108,9 +110,13 @@ int main(void)
}
} while(still_running);
- curl_multi_cleanup(multi_handle);
+ curl_multi_remove_handle(multi_handle, http_handle);
curl_easy_cleanup(http_handle);
+ curl_multi_cleanup(multi_handle);
+
+ curl_global_cleanup();
+
return 0;
}