Skip to content

Commit 82cac3f

Browse files
committed
Merge pull request #4 from J5lx/fix-second-close-in-destructor
Don’t close the cURL handle more than once
2 parents 4a5a95e + b89b26a commit 82cac3f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Curl/Curl.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ public function verbose($on=TRUE) {
121121
}
122122

123123
public function close() {
124-
curl_close($this->curl);
124+
if (is_resource($this->curl)) {
125+
curl_close($this->curl);
126+
}
125127
}
126128

127129
public function _exec() {

0 commit comments

Comments
 (0)