8000 Fix wrapped loop of event listener · symfony/symfony@d70a121 · GitHub
[go: up one dir, main page]

Skip to content

Commit d70a121

Browse files
committed
Fix wrapped loop of event listener
1 parent 6c3c47e commit d70a121

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,21 @@ public function dispatch($eventName, Event $event = null)
132132
}
133133

134134
$this->preProcess($eventName);
135-
$this->preDispatch($eventName, $event);
135+
try {
136+
$this->preDispatch($eventName, $event);
136137

137-
$e = $this->stopwatch->start($eventName, 'section');
138+
$e = $this->stopwatch->start($eventName, 'section');
138139

139-
$this->dispatcher->dispatch($eventName, $event);
140+
$this->dispatcher->dispatch($eventName, $event);
140141

141-
if ($e->isStarted()) {
142-
$e->stop();
143-
}
142+
if ($e->isStarted()) {
143+
$e->stop();
144+
}
144145

145-
$this->postDispatch($eventName, $event);
146-
$this->postProcess($eventName);
146+
$this->postDispatch($eventName, $event);
147+
} finally {
148+
$this->postProcess($eventName);
149+
}
147150

148151
return $event;
149152
}

0 commit comments

Comments
 (0)
0