改名
This commit is contained in:
@@ -59,14 +59,14 @@ class ObjectPool extends \Snowflake\Abstracts\Pool
|
|||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param $object
|
* @param $object
|
||||||
* @throws ComponentException
|
|
||||||
*/
|
*/
|
||||||
public function release(string $name, mixed $object)
|
public function release(string $name, mixed $object)
|
||||||
{
|
{
|
||||||
if (method_exists($object, 'clean')) {
|
$newObject = clone $object;
|
||||||
listen(Event::EVENT_AFTER_REQUEST,[$object,'clean']);
|
if (method_exists($newObject, 'clean')) {
|
||||||
|
$newObject->clean();
|
||||||
}
|
}
|
||||||
$this->push($name, $object);
|
$this->push($name, $newObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user