note 117662 added to function.curl-multi-close
| From: | Joey | Date: | Fri, 17 Jul 2015 12:10:56 +0000 |
| Subject: | note 117662 added to function.curl-multi-close | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203123@lists.php.net to get a copy of this message | ||
I second jonhohle.
I recently fixed a memory leak and found that curl_multi_add_handle behaves as though adding the
multi handler (mh) to the curl handler (ch) rather than vice versa.
This means that closing the mh wont free the mh unless it has been removed from all chs.
curl_multi_close will not cascade.
However, because the mh is added to the ch, you can close the ch without removing the mh. curl_close
will cascade.
I have no memory leak when using curl_close without curl_multi_remove_handle.
I think it would be good advice to add that as a rule of thumb all handlers should be remove or
closed when done with individually to avoid memory leaks and complexity. An extra remove mh with a
close ch wont do any harm.
----
Server IP: 72.52.91.14
Probable Submitter: 149.6.187.130
----
Manual Page -- http://php.net/manual/en/function.curl-multi-close.php
Edit -- https://master.php.net/note/edit/117662
Del: integrated -- https://master.php.net/note/delete/117662/integrated
Del: useless -- https://master.php.net/note/delete/117662/useless
Del: bad code -- https://master.php.net/note/delete/117662/bad+code
Del: spam -- https://master.php.net/note/delete/117662/spam
Del: non-english -- https://master.php.net/note/delete/117662/non-english
Del: in docs -- https://master.php.net/note/delete/117662/in+docs
Del: other reasons-- https://master.php.net/note/delete/117662
Reject -- https://master.php.net/note/reject/117662
Search -- https://master.php.net/manage/user-notes.php