Hello again,

this time I`m bugging you for something else ;)

I`ve been using Multi interface for some time and under some strange circumstances it threw an exception in destructor.

I found that it can happen when curl returns error, becouse remove() method is used in destructor and I don`t see any try/catch.

There is some bug in curl itself - sometimes it does return error when it isn`t supposed to. Valgrind shows ugly memory abuse inside libcurl.so, so in time I`ll report a bug to curl devteam.

See attached patch.


--
Best regards,
Piotr Niemcunowicz

--- ../original/curlpp/Multi.cpp        2007-01-14 01:43:26.000000000 +0100
+++ curlpp/Multi.cpp    2008-02-10 21:00:12.000000000 +0100
@@ -38,7 +38,9 @@
 {
   // remove all the remaining easy handles
   while (!mHandles.empty()) {
-      remove (mHandles.begin()->second);
+      std::map< CURL *, const cURLpp::Easy *>::iterator handle = 
mHandles.begin();
+      curl_multi_remove_handle(mMultiHandle, handle->second->getHandle());
+      mHandles.erase(handle);
   }
   curl_multi_cleanup(mMultiHandle);
 }
_______________________________________________
cURLpp mailing list
[email protected]
http://www.rrette.com/mailman/listinfo/curlpp

Reply via email to