Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Mac OS X 10.5 needs an autoreleasepool here to avoid memory leaks. Newer... #1587

Merged
merged 1 commit into from

4 participants

@mdehoon

... versions of Mac OS X do not, but it doesn't hurt to have one anyway. Without the autorelease pool, on Mac OS X 10.5 show() leaks memory and the OS prints error messages.

@mdehoon mdehoon Mac OS X 10.5 needs an autoreleasepool here to avoid memory leaks. Ne…
…wer versions of Mac OS X do not, but it doesn't hurt to have one anyway.
3c444b8
@pelson
Collaborator

:+1:

@mdboom
Owner

I'm not a Mac user, but maybe it would be helpful to have a script to reproduce the leak in the unit directory (where we have some other memory leaking stuff).

@mdehoon

Well it's a bit of a trivial leak, which only shows up on particular versions of Mac OS X; if it does show up, it is obvious since the OS prints out warning messages. Also this memory leak is independent of Python's garbage collector. So I think we can do without a specific test for this.

@mdehoon

Could somebody please accept this pull request? Then I can move on to the other open bugs.

@WeatherGod WeatherGod merged commit 9c60c58 into matplotlib:master
@mdehoon

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 11, 2012
  1. @mdehoon

    Mac OS X 10.5 needs an autoreleasepool here to avoid memory leaks. Ne…

    mdehoon authored
    …wer versions of Mac OS X do not, but it doesn't hurt to have one anyway.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  src/_macosx.m
View
2  src/_macosx.m
@@ -5693,12 +5693,14 @@ - (int)index
if(nwin > 0)
{
[NSApp activateIgnoringOtherApps: YES];
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSArray *windowsArray = [NSApp windows];
NSEnumerator *enumerator = [windowsArray objectEnumerator];
NSWindow *window;
while ((window = [enumerator nextObject])) {
[window orderFront:nil];
}
+ [pool release];
[NSApp run];
}
Py_INCREF(Py_None);
Something went wrong with that request. Please try again.