- proper request pool cleanup
[m6w6/ext-http] / http_methods.c
index cf8f25dd371807f818f86f264b739034694c4aeb..053fce7b232ee97845beb5a62b98d7bcbbbd38ff 100644 (file)
@@ -2119,7 +2119,7 @@ PHP_METHOD(HttpRequest, send)
 
        SET_EH_THROW_HTTP();
 
-       if (obj->attached) {
+       if (obj->pool) {
                http_error(E_WARNING, HTTP_E_CURL, "You cannot call HttpRequest::send() while attached to an HttpRequestPool");
                RETURN_FALSE;
        }
@@ -2153,6 +2153,15 @@ PHP_METHOD(HttpRequestPool, __construct)
 }
 /* }}} */
 
+PHP_METHOD(HttpRequestPool, __destruct)
+{
+       getObject(http_requestpool_object, obj);
+       
+       NO_ARGS;
+       
+       http_requestpool_object_ondestruct(&obj->pool);
+}
+
 /* {{{ proto bool HttpRequestPool::attach(HttpRequest request)
  *
  * Attach an HttpRequest object to this HttpRequestPool.