From b31251a7fdc55276bcf0bf5a8de054683d4eb03c Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Wed, 22 Apr 2015 02:39:59 -0700 Subject: [PATCH 1/2] Clean up --- tests/PHPCurlClass/PHPCurlClassTest.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/PHPCurlClass/PHPCurlClassTest.php b/tests/PHPCurlClass/PHPCurlClassTest.php index 8fa6258..5ccaf77 100644 --- a/tests/PHPCurlClass/PHPCurlClassTest.php +++ b/tests/PHPCurlClass/PHPCurlClassTest.php @@ -669,7 +669,8 @@ class CurlTest extends PHPUnit_Framework_TestCase $this->assertEquals('cookie1=scrumptious,cookie2=mouthwatering', $test->curl->response_headers['Set-Cookie']); } - public function testDefaultTimeout() { + public function testDefaultTimeout() + { $test = new Test(); $test->server('timeout', 'GET', array( 'seconds' => '31', @@ -681,7 +682,8 @@ class CurlTest extends PHPUnit_Framework_TestCase $this->assertFalse($test->curl->http_error); } - public function testTimeoutError() { + public function testTimeoutError() + { $test = new Test(); $test->curl->setTimeout(5); $test->server('timeout', 'GET', array( @@ -694,7 +696,8 @@ class CurlTest extends PHPUnit_Framework_TestCase $this->assertFalse($test->curl->http_error); } - public function testTimeout() { + public function testTimeout() + { $test = new Test(); $test->curl->setTimeout(10); $test->server('timeout', 'GET', array( From c2558f5dd416268c97189416ebbfeb91f90acf6a Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Wed, 22 Apr 2015 03:53:35 -0700 Subject: [PATCH 2/2] Fix memory leak --- src/Curl/Curl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index 0b5cbc2..970f567 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -133,6 +133,7 @@ class Curl if (is_resource($this->curl)) { curl_close($this->curl); } + $this->json_decoder = null; } public function complete($callback)