Skip to content

Commit 045669c

Browse files
committed
Merge pull request php-curl-class#177 from zachborboa/master
Fix a memory leak
2 parents e151a8c + c2558f5 commit 045669c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Curl/Curl.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public function close()
133133
if (is_resource($this->curl)) {
134134
curl_close($this->curl);
135135
}
136+
$this->json_decoder = null;
136137
}
137138

138139
public function complete($callback)

tests/PHPCurlClass/PHPCurlClassTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,8 @@ public function testMultipleCookieResponse()
669669
$this->assertEquals('cookie1=scrumptious,cookie2=mouthwatering', $test->curl->response_headers['Set-Cookie']);
670670
}
671671

672-
public function testDefaultTimeout() {
672+
public function testDefaultTimeout()
673+
{
673674
$test = new Test();
674675
$test->server('timeout', 'GET', array(
675676
'seconds' => '31',
@@ -681,7 +682,8 @@ public function testDefaultTimeout() {
681682
$this->assertFalse($test->curl->http_error);
682683
}
683684

684-
public function testTimeoutError() {
685+
public function testTimeoutError()
686+
{
685687
$test = new Test();
686688
$test->curl->setTimeout(5);
687689
$test->server('timeout', 'GET', array(
@@ -694,7 +696,8 @@ public function testTimeoutError() {
694696
$this->assertFalse($test->curl->http_error);
695697
}
696698

697-
public function testTimeout() {
699+
public function testTimeout()
700+
{
698701
$test = new Test();
699702
$test->curl->setTimeout(10);
700703
$test->server('timeout', 'GET', array(

0 commit comments

Comments
 (0)