merged branch chx/master (PR #7261)

This PR was submitted for the master branch but it was merged into the 2.1 branch instead (closes #7261).

Commits
-------

ff8c5ca Unset loading[$id] in ContainerBuilder on exception

Discussion
----------

Unset loading[$id] in ContainerBuilder on exception

This is the same functionality that Container provides.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

---------------------------------------------------------------------------

by vicb at 2013-03-04T22:43:07Z

could you add a unit test and use the standard PR header (symfony.com > doc > contributing). thanks.

---------------------------------------------------------------------------

by igorw at 2013-03-04T22:48:02Z

Can you add a test case? EDIT: I guess someone beat me to that comment. :)
This commit is contained in:
Fabien Potencier 2013-03-06 17:37:21 +01:00
commit 71cba81b89
1 changed files with 6 additions and 1 deletions

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]);