Skip to content

Commit e83bad5

Browse files
Merge branch '4.3' into 4.4
* 4.3: [DI] Dont cache classes with missing parents [HttpClient] Fix a crash when calling CurlHttpClient::__destruct() [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
2 parents 0e08473 + ae3a9cd commit e83bad5

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

CurlHttpClient.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,20 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
327327
public function __destruct()
328328
{
329329
$this->multi->pushedResponses = [];
330-
if (\defined('CURLMOPT_PUSHFUNCTION')) {
331-
curl_multi_setopt($this->multi->handle, CURLMOPT_PUSHFUNCTION, null);
332-
}
333330

334-
$active = 0;
335-
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
331+
if (\is_resource($this->multi->handle)) {
332+
if (\defined('CURLMOPT_PUSHFUNCTION')) {
333+
curl_multi_setopt($this->multi->handle, CURLMOPT_PUSHFUNCTION, null);
334+
}
335+
336+
$active = 0;
337+
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
338+
}
336339

337340
foreach ($this->multi->openHandles as [$ch]) {
338-
curl_setopt($ch, CURLOPT_VERBOSE, false);
341+
if (\is_resource($ch)) {
342+
curl_setopt($ch, CURLOPT_VERBOSE, false);
343+
}
339344
}
340345
}
341346

0 commit comments

Comments
 (0)