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

Skip to content

Commit e68cfac

Browse files
don't store icon as global; re-load instead
1 parent fb50762 commit e68cfac

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,24 +1360,18 @@ def _load_bitmap(filename):
13601360
return bmp
13611361

13621362

1363-
_FRAME_ICON = None
1364-
1365-
13661363
def _set_frame_icon(frame):
13671364
# set frame icon
1368-
global _FRAME_ICON
1369-
if not _FRAME_ICON:
1370-
_FRAME_ICON = bundle = wx.IconBundle()
1371-
for image in ('matplotlib.png', 'matplotlib_large.png'):
1372-
image = os.path.join(matplotlib.rcParams['datapath'], 'images',
1373-
image)
1374-
if not os.path.exists(image):
1375-
continue
1376-
icon = wx.Icon(_load_bitmap(image))
1377-
if not icon.IsOk():
1378-
return
1379-
bundle.AddIcon(icon)
1380-
frame.SetIcons(_FRAME_ICON)
1365+
bundle = wx.IconBundle()
1366+
for image in ('matplotlib.png', 'matplotlib_large.png'):
1367+
image = os.path.join(matplotlib.rcParams['datapath'], 'images', image)
1368+
if not os.path.exists(image):
1369+
continue
1370+
icon = wx.Icon(_load_bitmap(image))
1371+
if not icon.IsOk():
1372+
return
1373+
bundle.AddIcon(icon)
1374+
frame.SetIcons(bundle)
13811375

13821376

13831377
class MenuButtonWx(wx.Button):

0 commit comments

Comments
 (0)