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

Skip to content

Commit 9c60c58

Browse files
committed
Merge pull request matplotlib#1587 from mdehoon/fix-show-memoryleak
Mac OS X 10.5 needs an autoreleasepool here to avoid memory leaks. Newer...
2 parents 32149e4 + 3c444b8 commit 9c60c58

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/_macosx.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5693,12 +5693,14 @@ - (int)index
56935693
if(nwin > 0)
56945694
{
56955695
[NSApp activateIgnoringOtherApps: YES];
5696+
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
56965697
NSArray *windowsArray = [NSApp windows];
56975698
NSEnumerator *enumerator = [windowsArray objectEnumerator];
56985699
NSWindow *window;
56995700
while ((window = [enumerator nextObject])) {
57005701
[window orderFront:nil];
57015702
}
5703+
[pool release];
57025704
[NSApp run];
57035705
}
57045706
Py_INCREF(Py_None);

0 commit comments

Comments
 (0)