Break reference cycle created by default in Flask instances.
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Flask instances with static folders were creating a reference cycle via their "static" view function (which held a strong reference back to the Flask instance to call its `send_static_file` method). This prevented CPython from freeing the memory for a Flask instance when all external references to it were released. Now use a weakref for the back reference to avoid this.
authored by Bogdan Opanchuk · committed by GitHub · parent 4e8b020 · Browse files · 2 files+29 added−1 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: Joshua Bronson <jab@users.noreply.github.com>
Diff stats
2 files+29 added−1 removed
- tests:+24 added−0 removed
- other:+5 added−1 removed