FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Backport PR #23712 on branch v3.6.x (FIX: do not try to help CPython with garbage collection) by meeseeksmachine · Pull Request #23739 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
9 changes: 0 additions & 9 deletions lib/matplotlib/_pylab_helpers.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import atexit
from collections import OrderedDict
import gc


class Gcf:
Expand Down Expand Up @@ -66,10 +65,6 @@ def destroy(cls, num):
manager.canvas.mpl_disconnect(manager._cidgcf)
manager.destroy()
del manager, num
# Full cyclic garbage collection may be too expensive to do on every
# figure destruction, so we collect only the youngest two generations.
# see: https://github.com/matplotlib/matplotlib/pull/3045
gc.collect(1)

@classmethod
def destroy_fig(cls, fig):
Expand All @@ -82,14 +77,10 @@ def destroy_fig(cls, fig):
@classmethod
def destroy_all(cls):
"""Destroy all figures."""
# Reimport gc in case the module globals have already been removed
# during interpreter shutdown.
import gc
for manager in list(cls.figs.values()):
manager.canvas.mpl_disconnect(manager._cidgcf)
manager.destroy()
cls.figs.clear()
gc.collect(1)

@classmethod
def has_fignum(cls, num):
Expand Down

Back | FazBrowse Home | New Git URL