Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/Symfony/Component/DependencyInjection/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,13 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE
try {
$service = $this->$method();
} catch (\Exception $e) {
unset($this->loading[$id]);

if (array_key_exists($id, $this->services)) {
unset($this->services[$id]);
}
unset($this->services[$id]);

throw $e;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this call is not necessary, we could remove it in older branches too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} finally {
unset($this->loading[$id]);
}

unset($this->loading[$id]);

return $service;
}
}
Expand Down