Merge pull request #177 from zachborboa/master

Fix a memory leak
This commit is contained in:
Zach Borboa
2015-04-22 04:02:47 -07:00
2 changed files with 7 additions and 3 deletions
+1
View File
@@ -133,6 +133,7 @@ class Curl
if (is_resource($this->curl)) {
curl_close($this->curl);
}
$this->json_decoder = null;
}
public function complete($callback)
+6 -3
View File
@@ -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(