Skip to content
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

Breaking a ref cycle created by default in Flask() #3762

Merged
merged 3 commits into from
Oct 3, 2020

Conversation

fjarri
Copy link
Contributor

@fjarri fjarri commented Sep 23, 2020

Fixes #3761

Breaks the ref cycle Flask -> view_functions -> self.send_static_file -> Flask that is created in the constructor.

Copy link
Member

@jab jab left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I’m not sure if we’ll end up accepting this change (defer to @davidism), but in the meantime it wouldn’t hurt to add some test coverage. Here’s an example of some test coverage I added to one of my projects to prove my weakrefs are working as intended, in case it’s helpful: https://github.com/jab/bidict/blob/master/tests/properties/test_properties.py#L273

@fjarri
Copy link
Contributor Author

fjarri commented Sep 23, 2020

Thanks for the pointer, I added a test (shamelessly stole most of it from your project).

@fjarri fjarri force-pushed the break-ref-cycle branch 2 times, most recently from c7c7ae7 to bf156fc Compare September 23, 2020 06:22
jab added a commit to fjarri/flask that referenced this pull request Oct 3, 2020
@jab jab merged commit 8efea0c into pallets:master Oct 3, 2020
@davidism davidism added this to the 2.0.0 milestone Oct 3, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A Flask app holds a reference to itself
3 participants