Clean up completed multi curl instance to fix memory leak

This commit is contained in:
Zach Borboa
2017-04-30 03:10:24 -07:00
parent d214d6b767
commit d21a7dcc8b
+4
View File
@@ -662,6 +662,7 @@ class MultiCurl
$ch->curlErrorCode = $info_array['result'];
$ch->exec($ch->curl);
// Remove completed instance from active curls.
unset($this->activeCurls[$key]);
// Start a new request before removing the handle of the completed one.
@@ -670,6 +671,9 @@ class MultiCurl
}
curl_multi_remove_handle($this->multiCurl, $ch->curl);
// Clean up completed instance.
$ch->close();
break;
}
}