Permalink
Browse files

Fix memory leak in Doctrine Autoload Proxy Magic

  • Loading branch information...
1 parent f530057 commit 12fb9e5b27560582a668813b461fc1c522c8f88a @beberlei beberlei committed Feb 23, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 DoctrineBundle.php
View
@@ -48,9 +48,11 @@ public function boot()
if ($this->container->hasParameter('doctrine.orm.proxy_namespace')) {
$namespace = $this->container->getParameter('doctrine.orm.proxy_namespace');
$dir = $this->container->getParameter('doctrine.orm.proxy_dir');
- $container = $this->container;
+ // See https://github.com/symfony/symfony/pull/3419 for usage of
+ // references
+ $container =& $this->container;
- spl_autoload_register(function($class) use ($namespace, $dir, $container) {
+ spl_autoload_register(function($class) use ($namespace, $dir, &$container) {
if (0 === strpos($class, $namespace)) {
$className = str_replace('\\', '', substr($class, strlen($namespace) +1));
$file = $dir.DIRECTORY_SEPARATOR.$className.'.php';

0 comments on commit 12fb9e5

Please sign in to comment.