8000 [SecurityBundle] Fixed a memory leak in SecurityBundle\Security\FirewallMap by udavka · Pull Request #22605 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[SecurityBundle] Fixed a memory leak in SecurityBundle\Security\FirewallMap #22605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Fixed on review comments
  • Loading branch information
udavka committed May 13, 2017
commit 815fb8be96db50deb8d83660a81fc976974b8741
19 changes: 2 additions & 17 deletions src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,13 @@ private function getFirewallContext(Request $request)
}
}

/**
* @param FinishRequestEvent $event
*/
public function onKernelFinishRequest(FinishRequestEvent $event)
{
$this->detachListeners($event->getRequest());
}

/**
* Cleans up the internal state of the firewall map.
*
* @param Request $request
*/
private function detachListeners(Request $request)
{
unset($this->contexts[$request]);
unset($this->contexts[$event->getRequest()]);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO you should directly unset the request in the onKernelFinishRequest method, that would make one less method call...

Copy link
Author

Choose a reason for hiding this comment

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

fixed


/**
* Get subscribed events.
*
* @return array Subscribed events
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
Expand Down
0