[HttpKernel] fixed profile saving when it has children

This commit is contained in:
Fabien Potencier 2011-10-15 01:46:19 +02:00
parent 3d7510e921
commit c0f5b8a3b6

View File

@ -89,11 +89,12 @@ class ProfilerListener
if ($profile = $this->profiler->collect($event->getRequest(), $event->getResponse(), $exception)) {
if ($master) {
$this->profiler->saveProfile($profile);
foreach ($this->children as $child) {
$child->setParent($profile);
$profile->addChild($child);
$this->profiler->saveProfile($child);
}
$this->profiler->saveProfile($profile);
$this->children = array();
} else {
$this->children[] = $profile;