Minor cleanup in CURLBindings

This commit is contained in:
Joshua Granick
2019-01-18 10:51:42 -08:00
parent ac7b0914b9
commit 0c73e47b28

View File

@@ -70,6 +70,25 @@ namespace lime {
curl_multi_remove_handle ((CURLM*)val_data (multi_handle), (CURL*)val_data (handle));
curlMultiReferences.erase (handle);
std::vector<void*>* handles = curlMultiHandles[multi_handle];
if (handles->size () > 0) {
for (std::vector<void*>::iterator it = handles->begin (); it != handles->end (); ++it) {
if (*it == handle) {
handles->erase (it);
delete curlMultiObjects[handle];
curlMultiObjects.erase (handle);
break;
}
}
}
}
if (curlValid.find (handle) != curlValid.end ()) {
@@ -184,6 +203,25 @@ namespace lime {
curl_multi_remove_handle ((CURLM*)multi_handle->ptr, (CURL*)handle->ptr);
curlMultiReferences.erase (handle);
std::vector<void*>* handles = curlMultiHandles[multi_handle];
if (handles->size () > 0) {
for (std::vector<void*>::iterator it = handles->begin (); it != handles->end (); ++it) {
if (*it == handle) {
handles->erase (it);
delete curlMultiObjects[handle];
curlMultiObjects.erase (handle);
break;
}
}
}
}
if (curlValid.find (handle) != curlValid.end ()) {