Skip to content

Commit cb243af

Browse files
Fix NSAutoReleasePool failure
Do not want to instantiate at import time.
1 parent fd7aab3 commit cb243af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/backend_mac_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def __exit__(self, exc_type, exc_val, exc_tb):
5757
return False
5858

5959

60-
@NSAutoReleasePool()
6160
def _set_icon(filepath):
6261
objc = ObjCDll()
6362
app = objc.objc_msgSend(objc.objc_getClass("NSApplication"),
@@ -86,7 +85,8 @@ def set_mac_icon():
8685
if sys.platform == "darwin":
8786
from matplotlib import cbook
8887
image = str(cbook._get_data_path('images/matplotlib.pdf'))
89-
_set_icon(image)
88+
with NSAutoReleasePool():
89+
_set_icon(image)
9090
return True
9191

9292
return False

0 commit comments

Comments
 (0)