Dropped any events that aren't properly stopped.

This commit is contained in:
Andrey Savchenko committed 2018-02-08 19:10:57 +02:00
1 parent 79e197c4cc
commit 228ea99b43
1 file changed
+6
+6
View File
@@ -109,6 +109,12 @@ class Hook_Events_Provider implements ServiceProviderInterface, Bootable_Provide
$events = $this->stopwatch->getSectionEvents( '__root__' ); $events = $this->stopwatch->getSectionEvents( '__root__' );
foreach ( array_keys( $events ) as $name ) {
if ( $this->stopwatch->isStarted( $name ) ) {
unset( $events[ $name ] );
}
}
return array_map( [ $this, 'transform' ], array_keys( $events ), $events ); return array_map( [ $this, 'transform' ], array_keys( $events ), $events );
} }