Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Break reference cycle Line2D <-> Line2D._lineFunc. #6821
Conversation
mdboom
added the
needs_review
label
Jul 24, 2016
|
Looks good to me. Why didn't Travis run? |
|
Not sure why... it built on my side: https://travis-ci.org/anntzer/matplotlib/builds/146967616 (docs never build for me, btw... suggestions welcome). |
Kojoley
and 2 others
commented on an outdated diff
Jul 24, 2016
| @@ -236,7 +236,7 @@ def test_grid(): | ||
| fig = manager.canvas.figure | ||
| ax = fig.add_subplot(1, 1, 1) | ||
| ax.grid() | ||
| - # Drawing the grid triggers instance methods to be attached | ||
| + # Drawing the grid used to trigger instance methods to be attached | ||
| # to the Line2D object (_lineFunc). |
efiring
Owner
|
|
The docs build fails for you on travis because the install of basemap causes matplotlib to be downgraded to 1.5.1. This is most likely because your fork does not have all the tags which confuses the versioneer version script. I suggest pushing the tags to your branch.
|
jenshnielsen
closed this
Jul 24, 2016
jenshnielsen
reopened this
Jul 24, 2016
jenshnielsen
added needs_review and removed needs_review
labels
Jul 24, 2016
|
I opened and closed the pr to re trigger travis |
|
Thanks for the help re: docs. |
WeatherGod
commented on the diff
Jul 28, 2016
| @@ -1250,9 +1244,6 @@ def set_dashes(self, seq): | ||
| else: | ||
| self.set_linestyle((0, seq)) | ||
| - def _draw_lines(self, renderer, gc, path, trans): |
WeatherGod
Member
|
|
btw, in case it isn't clear, this can not be backported to v2.x branch as-is because there are more usages of |
tacaswell
added this to the
2.1 (next point release)
milestone
Jul 28, 2016
|
|
anntzer commentedJul 24, 2016
Upon drawing, Line2D objects would store a reference to one of their own
bound methods as their
_lineFuncargument. This would lead to thembeing gc'ed not when going out of scope, but only when the "true" gc
kicks in; additionally this led to some pickle-related bugs (#3627).
One can easily sidestep this problem by not storing this bound method.
To check the behavior, try (py3.4+ only):
Before the patch, the AxesImage is gc'ed when the function exits but the
Line2D only upon explicit garbage collection. After the patch, both are
collected immediately.