Unset loading[$id] in ContainerBuilder on exception

This commit is contained in:
chx 2013-03-04 13:57:29 -08:00 committed by Fabien Potencier
parent 0e7b5fb3bb
commit e86fefa709

View File

@ -350,7 +350,12 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
$this->loading[$id] = true;
$service = $this->createService($definition, $id);
try {
$service = $this->createService($definition, $id);
} catch (\Exception $e) {
unset($this->loading[$id]);
throw $e;
}
unset($this->loading[$id]);