File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 143
143
144
144
->set ('controller.cache_attribute_listener ' , CacheAttributeListener::class)
145
145
->tag ('kernel.event_subscriber ' )
146
+ ->tag ('kernel.reset ' , ['method ' => 'reset ' ])
146
147
147
148
;
148
149
};
Original file line number Diff line number Diff line change 26
26
"symfony/error-handler" : " ^6.1|^7.0" ,
27
27
"symfony/event-dispatcher" : " ^5.4|^6.0|^7.0" ,
28
28
"symfony/http-foundation" : " ^6.4|^7.0" ,
29
- "symfony/http-kernel" : " ^6.4" ,
29
+ "symfony/http-kernel" : " ^6.4.23 " ,
30
30
"symfony/polyfill-mbstring" : " ~1.0" ,
31
31
"symfony/filesystem" : " ^5.4|^6.0|^7.0" ,
32
32
"symfony/finder" : " ^5.4|^6.0|^7.0" ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ CHANGELOG
4
4
6.4
5
5
---
6
6
7
+ * ` Symfony\Component\HttpKernel\EventListener\CacheAttributeListener ` is now resettable to prevent memory leaks
7
8
* Support backed enums in #[ MapQueryParameter]
8
9
* ` BundleInterface ` no longer extends ` ContainerAwareInterface `
9
10
* Add optional ` $className ` parameter to ` ControllerEvent::getAttributes() `
Original file line number Diff line number Diff line change 19
19
use Symfony \Component \HttpKernel \Event \ControllerArgumentsEvent ;
20
20
use Symfony \Component \HttpKernel \Event \ResponseEvent ;
21
21
use Symfony \Component \HttpKernel \KernelEvents ;
22
+ use Symfony \Contracts \Service \ResetInterface ;
22
23
23
24
/**
24
25
* Handles HTTP cache headers configured via the Cache attribute.
25
26
*
26
27
* @author Fabien Potencier <fabien@symfony.com>
27
28
*/
28
- class CacheAttributeListener implements EventSubscriberInterface
29
+ class CacheAttributeListener implements EventSubscriberInterface, ResetInterface
29
30
{
30
31
/**
31
32
* @var \SplObjectStorage<Request, \DateTimeInterface>
@@ -178,6 +179,12 @@ public static function getSubscribedEvents(): array
178
179
];
179
180
}
180
181
182
+ public function reset (): void
183
+ {
184
+ $ this ->lastModified = new \SplObjectStorage ();
185
+ $ this ->etags = new \SplObjectStorage ();
186
+ }
187
+
181
188
private function getExpressionLanguage (): ExpressionLanguage
182
189
{
183
190
return $ this ->expressionLanguage ??= class_exists (ExpressionLanguage::class)
You can’t perform that action at this time.
0 commit comments