Skip to content

Commit

Permalink
don't keep references to handlers in app
Browse files Browse the repository at this point in the history
  • Loading branch information
provinzkraut committed Jan 13, 2025
1 parent 0271421 commit 606a99d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions litestar/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ def __init__(
for route_handler in self._reduce_handlers(self.route_handlers):
self._finalize_routes(route_handler)

# we have merged everything registered initially, so let's ensure we don't keep
# unnecessary references to temporary objects around and let them be gc'ed
self.route_handlers = ()

self.asgi_router.construct_routing_trie()

if self.logging_config:
Expand Down

0 comments on commit 606a99d

Please sign in to comment.