Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 175e3ec

Browse files
committed
moved agg caches to instance namespace for thread safety
svn path=/trunk/matplotlib/; revision=7008
1 parent f383777 commit 175e3ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/backends/backend_agg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ class RendererAgg(RendererBase):
4646
context instance that controls the colors/styles
4747
"""
4848
debug=1
49-
texd = maxdict(50) # a cache of tex image rasters
50-
_fontd = maxdict(50)
5149
def __init__(self, width, height, dpi):
5250
if __debug__: verbose.report('RendererAgg.__init__', 'debug-annoying')
5351
RendererBase.__init__(self)
52+
self.texd = maxdict(50) # a cache of tex image rasters
53+
self._fontd = maxdict(50)
54+
5455
self.dpi = dpi
5556
self.width = width
5657
self.height = height

0 commit comments

Comments
 (0)