8000 [DI] Clear service reference graph · symfony/symfony@bfb4c45 · GitHub
[go: up one dir, main page]

Skip to content

Commit bfb4c45

Browse files
[DI] Clear service reference graph
1 parent a19d1e5 commit bfb4c45

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/Symfony/Component/DependencyInjection/Compiler/Compiler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ public function compile(ContainerBuilder $container)
159159
}
160160

161161
throw $e;
162+
} finally {
163+
$this->getServiceReferenceGraph()->clear();
162164
}
163165
}
164166
}

src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraph.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public function getNodes()
7575
*/
7676
public function clear()
7777
{
78+
foreach ($this->nodes as $node) {
79+
$node->clear();
80+
}
7881
$this->nodes = array();
7982
}
8083

src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,12 @@ public function getValue()
107107
{
108108
return $this->value;
109109
}
110+
111+
/**
112+
* Clears all edges.
113+
*/
114+
public function clear()
115+
{
116+
$this->inEdges = $this->outEdges = array();
117+
}
110118
}

0 commit comments

Comments
 (0)
0