mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 04:01:47 +00:00
Clean up completed multi curl instance to fix memory leak
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user