File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55import atexit
66from collections import OrderedDict
7- import gc
87
98
109class Gcf :
@@ -66,10 +65,6 @@ def destroy(cls, num):
6665 manager .canvas .mpl_disconnect (manager ._cidgcf )
6766 manager .destroy ()
6867 del manager , num
69- # Full cyclic garbage collection may be too expensive to do on every
70- # figure destruction, so we collect only the youngest two generations.
71- # see: https://github.com/matplotlib/matplotlib/pull/3045
72- gc .collect (1 )
7368
7469 @classmethod
7570 def destroy_fig (cls , fig ):
@@ -82,14 +77,10 @@ def destroy_fig(cls, fig):
8277 @classmethod
8378 def destroy_all (cls ):
8479 """Destroy all figures."""
85- # Reimport gc in case the module globals have already been removed
86- # during interpreter shutdown.
87- import gc
8880 for manager in list (cls .figs .values ()):
8981 manager .canvas .mpl_disconnect (manager ._cidgcf )
9082 manager .destroy ()
9183 cls .figs .clear ()
92- gc .collect (1 )
9384
9485 @classmethod
9586 def has_fignum (cls , num ):
You can’t perform that action at this time.
0 commit comments